Bug 159081
| Summary: | make rest parameters faster | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Saam Barati <saam> |
| Component: | JavaScriptCore | Assignee: | Saam Barati <saam> |
| Status: | NEW | ||
| Severity: | Normal | CC: | benjamin, fpizlo, ggaren, gskachkov, keith_miller, mark.lam, msaboff, oliver, sukolsak, ysuzuki |
| Priority: | P2 | ||
| Version: | WebKit Local Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | 159612 | ||
| Bug Blocks: | |||
Saam Barati
....
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Filip Pizlo
Thought about this more. I like that CopyRest is a node. If only we could make it so that the use of the rest array for forwarding arguments was also a node so that:
function foo(a, b, c, ...args) { return bar(b, c, d, ...args); }
looked like this:
w: CopyRest(...)
x: NewArray(b, c, d)
y: ConcatArray(@x, @w)
z: TailCallVarargs(bar, @y)
I'm not sure how we'll compile "...args" in the call to bar(), but I'm pretty sure it'll be more obfuscated than this.
If we could get to a point where the DFG saw this, then we could have arguments forwarding turn this into code that never allocated anything.