Bug 256026 - Investigate fast path for Object.assign({}, nonEmptyObject)
Summary: Investigate fast path for Object.assign({}, nonEmptyObject)
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yijia Huang
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-04-26 21:28 PDT by Jarred Sumner
Modified: 2023-09-05 09:26 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jarred Sumner 2023-04-26 21:28:23 PDT
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?
Comment 1 Radar WebKit Bug Importer 2023-05-03 21:29:22 PDT
<rdar://problem/108875645>
Comment 2 Yijia Huang 2023-08-30 11:52:09 PDT
Pull request: https://github.com/WebKit/WebKit/pull/17242
Comment 3 Yijia Huang 2023-09-05 09:26:30 PDT
Pull request: https://github.com/WebKit/WebKit/pull/17312