|
[turbofan] Avoid allocating rest parameters for spread calls.
We already had an optimization to turn Function.prototype.apply with
arguments object, i.e.
function foo() { return bar.apply(this, arguments); }
into a special operator JSCallForwardVarargs, which avoids the
allocation and deconstruction of the arguments object, but just passes
along the incoming parameters. We can do the same for rest parameters
and spread calls/constructs, i.e.
class A extends B {
constructor(...args) { super(...args); }
}
or
function foo(...args) { return bar(1, 2, 3, ...args); }
where we basically pass along the parameters (plus maybe additional
statically known parameters).
For this, we introduce a new JSConstructForwardVarargs operator and
generalize the CallForwardVarargs builtins that are backing this.
BUG= v8:6407, v8:6278, v8:6344
R=jarin@chromium.org
Review-Url: https://codereview.chromium.org/2890023004
Cr-Commit-Position: refs/heads/master@{#45388}
Committed: https://chromium.googlesource.com/v8/v8/+/bfa319e5d3f902e504c00af5607117d1eb5d6273
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+470 lines, -219 lines) |
Patch |
|
M |
src/arm/interface-descriptors-arm.cc
|
View
|
|
1 chunk |
+12 lines, -1 line |
0 comments
|
Download
|
|
M |
src/arm64/interface-descriptors-arm64.cc
|
View
|
|
1 chunk |
+12 lines, -1 line |
0 comments
|
Download
|
|
M |
src/builtins/arm/builtins-arm.cc
|
View
|
|
2 chunks |
+24 lines, -28 lines |
0 comments
|
Download
|
|
M |
src/builtins/arm64/builtins-arm64.cc
|
View
|
|
2 chunks |
+23 lines, -28 lines |
0 comments
|
Download
|
|
M |
src/builtins/builtins.h
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
src/builtins/builtins-call-gen.cc
|
View
|
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
|
M |
src/builtins/builtins-constructor-gen.cc
|
View
|
|
1 chunk |
+9 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/builtins/builtins-definitions.h
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/builtins/ia32/builtins-ia32.cc
|
View
|
|
4 chunks |
+28 lines, -27 lines |
0 comments
|
Download
|
|
M |
src/builtins/mips/builtins-mips.cc
|
View
|
|
1 chunk |
+25 lines, -29 lines |
0 comments
|
Download
|
|
M |
src/builtins/mips64/builtins-mips64.cc
|
View
|
|
1 chunk |
+25 lines, -29 lines |
0 comments
|
Download
|
|
M |
src/builtins/x64/builtins-x64.cc
|
View
|
|
2 chunks |
+20 lines, -24 lines |
0 comments
|
Download
|
|
M |
src/code-factory.h
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/code-factory.cc
|
View
|
|
1 chunk |
+12 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/compiler/js-call-reducer.cc
|
View
|
|
4 chunks |
+56 lines, -25 lines |
0 comments
|
Download
|
|
M |
src/compiler/js-generic-lowering.cc
|
View
|
|
2 chunks |
+28 lines, -3 lines |
0 comments
|
Download
|
|
M |
src/compiler/js-operator.h
|
View
|
|
5 chunks |
+44 lines, -5 lines |
0 comments
|
Download
|
|
M |
src/compiler/js-operator.cc
|
View
|
|
4 chunks |
+26 lines, -4 lines |
0 comments
|
Download
|
|
M |
src/compiler/js-typed-lowering.h
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
src/compiler/js-typed-lowering.cc
|
View
|
|
4 chunks |
+42 lines, -4 lines |
0 comments
|
Download
|
|
M |
src/compiler/opcodes.h
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
src/compiler/operator-properties.cc
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
src/compiler/typer.cc
|
View
|
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/compiler/verifier.cc
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
src/ia32/interface-descriptors-ia32.cc
|
View
|
|
1 chunk |
+12 lines, -1 line |
0 comments
|
Download
|
|
M |
src/interface-descriptors.h
|
View
|
|
2 chunks |
+9 lines, -1 line |
0 comments
|
Download
|
|
M |
src/interface-descriptors.cc
|
View
|
|
1 chunk |
+11 lines, -1 line |
0 comments
|
Download
|
|
M |
src/mips/interface-descriptors-mips.cc
|
View
|
|
1 chunk |
+12 lines, -1 line |
0 comments
|
Download
|
|
M |
src/mips64/interface-descriptors-mips64.cc
|
View
|
|
1 chunk |
+12 lines, -1 line |
0 comments
|
Download
|
|
M |
src/x64/interface-descriptors-x64.cc
|
View
|
|
1 chunk |
+12 lines, -1 line |
0 comments
|
Download
|
Total messages: 12 (7 generated)
|