Bug 256026
| Summary: | Investigate fast path for Object.assign({}, nonEmptyObject) | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Jarred Sumner <jarred> |
| Component: | JavaScriptCore | Assignee: | Yijia Huang <yijia_huang> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | ashvayka, mark.lam, webkit-bug-importer, ysuzuki |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Jarred Sumner
The following common pattern could possibly be optimized further:
```
Object.assign({}, nonEmptyObject);
```
If we know that {} is an empty final object, could we reuse nonEmptyObject's JSC::Structure?
> https://github.com/WebKit/WebKit/pull/13220#issuecomment-1524421218
> I think probably opposite case is getting many benefit from the past optimizations already, but we could get better by detecting empty object of the target in DFG / FTL and change it to object-cloning fast path. Can you file a bugzilla to track this kind of possibility?
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/108875645>
Yijia Huang
Pull request: https://github.com/WebKit/WebKit/pull/17242
Yijia Huang
Pull request: https://github.com/WebKit/WebKit/pull/17312