Bug 185039
| Summary: | DFGArgumentsEliminationPhase should be able to get rid of allocations for NewArrayWithSpread made of other NewArrayWithSpread | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Robin Morisset <rmorisset> |
| Component: | JavaScriptCore | Assignee: | Robin Morisset <rmorisset> |
| Status: | NEW | ||
| Severity: | Normal | CC: | saam |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=183172 | ||
Robin Morisset
I am thinking of code like the following (admittedly a bit artificial):
function f(...a) {
var b = [...a, ...a];
var c = [...b, 42, ...b]
// do stuff with c here without letting it escape
}
There is no good reason for this code not to be optimized, but currently we only optimize NewArrayWithSpread if its Spread(s) come from a NewArrayBuffer or a CreateRest, and not if they come for example from a NewArrayWithSpread.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |