|
[runtime] Optimize and unify rest parameters.
Replace the somewhat awkward RestParamAccessStub, which would always
call into the runtime anyway with a proper FastNewRestParameterStub,
which is basically based on the code that was already there for strict
arguments object materialization. But for rest parameters we could
optimize even further (leading to 8-10x improvements for functions with
rest parameters), by fixing the internal formal parameter count:
Every SharedFunctionInfo has a formal_parameter_count field, which
specifies the number of formal parameters, and is used to decide whether
we need to create an arguments adaptor frame when calling a function
(i.e. if there's a mismatch between the actual and expected parameters).
Previously the formal_parameter_count included the rest parameter, which
was sort of unfortunate, as that meant that calling a function with only
the non-rest parameters still required an arguments adaptor (plus some
other oddities). Now with this CL we fix, so that we do no longer
include the rest parameter in that count. Thereby checking for rest
parameters is very efficient, as we only need to check whether there is
an arguments adaptor frame, and if not create an empty array, otherwise
check whether the arguments adaptor frame has more parameters than
specified by the formal_parameter_count.
The FastNewRestParameterStub is written in a way that it can be directly
used by Ignition as well, and with some tweaks to the TurboFan backends
and the CodeStubAssembler, we should be able to rewrite it as
TurboFanCodeStub in the near future.
Drive-by-fix: Refactor and unify the CreateArgumentsType which was
different in TurboFan and Ignition; now we have a single enum class
which is used in both TurboFan and Ignition.
R=jarin@chromium.org, rmcilroy@chromium.org
TBR=rossberg@chromium.org
BUG= v8:2159
LOG=n
Committed: https://crrev.com/3ef573e9f127345cd9d04d7f9f5e51bf169ae103
Cr-Commit-Position: refs/heads/master@{#33809}
Total comments: 1
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+1149 lines, -584 lines) |
Patch |
|
M |
src/arm/code-stubs-arm.cc
|
View
|
|
2 chunks |
+142 lines, -22 lines |
0 comments
|
Download
|
|
M |
src/arm/interface-descriptors-arm.cc
|
View
|
|
2 chunks |
+7 lines, -5 lines |
0 comments
|
Download
|
|
M |
src/arm64/code-stubs-arm64.cc
|
View
|
|
2 chunks |
+147 lines, -48 lines |
0 comments
|
Download
|
|
M |
src/arm64/interface-descriptors-arm64.cc
|
View
|
|
2 chunks |
+8 lines, -5 lines |
0 comments
|
Download
|
|
M |
src/ast/scopes.h
|
View
|
|
1 chunk |
+18 lines, -1 line |
0 comments
|
Download
|
|
M |
src/code-factory.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
src/code-factory.cc
|
View
|
|
2 chunks |
+7 lines, -7 lines |
0 comments
|
Download
|
|
M |
src/code-stubs.h
|
View
|
|
4 chunks |
+15 lines, -15 lines |
0 comments
|
Download
|
|
M |
src/code-stubs.cc
|
View
|
|
2 chunks |
+0 lines, -8 lines |
0 comments
|
Download
|
|
M |
src/compiler/ast-graph-builder.cc
|
View
|
|
2 chunks |
+6 lines, -6 lines |
0 comments
|
Download
|
|
M |
src/compiler/bytecode-graph-builder.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
src/compiler/bytecode-graph-builder.cc
|
View
|
|
1 chunk |
+6 lines, -9 lines |
0 comments
|
Download
|
|
M |
src/compiler/js-call-reducer.cc
|
View
|
|
2 chunks |
+8 lines, -4 lines |
0 comments
|
Download
|
|
M |
src/compiler/js-generic-lowering.cc
|
View
|
|
1 chunk |
+6 lines, -7 lines |
0 comments
|
Download
|
|
M |
src/compiler/js-operator.h
|
View
|
|
2 chunks |
+3 lines, -29 lines |
0 comments
|
Download
|
|
M |
src/compiler/js-operator.cc
|
View
|
|
2 chunks |
+8 lines, -34 lines |
0 comments
|
Download
|
|
M |
src/compiler/js-typed-lowering.cc
|
View
|
|
7 chunks |
+21 lines, -22 lines |
0 comments
|
Download
|
|
M |
src/full-codegen/arm/full-codegen-arm.cc
|
View
|
|
1 chunk |
+5 lines, -14 lines |
0 comments
|
Download
|
|
M |
src/full-codegen/arm64/full-codegen-arm64.cc
|
View
|
|
1 chunk |
+5 lines, -14 lines |
0 comments
|
Download
|
|
M |
src/full-codegen/ia32/full-codegen-ia32.cc
|
View
|
|
1 chunk |
+5 lines, -13 lines |
0 comments
|
Download
|
|
M |
src/full-codegen/mips/full-codegen-mips.cc
|
View
|
|
1 chunk |
+5 lines, -15 lines |
0 comments
|
Download
|
|
M |
src/full-codegen/mips64/full-codegen-mips64.cc
|
View
|
|
1 chunk |
+5 lines, -14 lines |
0 comments
|
Download
|
|
M |
src/full-codegen/x64/full-codegen-x64.cc
|
View
|
|
1 chunk |
+5 lines, -14 lines |
0 comments
|
Download
|
|
M |
src/globals.h
|
View
|
|
1 chunk |
+24 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/ia32/code-stubs-ia32.cc
|
View
|
|
2 chunks |
+147 lines, -28 lines |
0 comments
|
Download
|
|
M |
src/ia32/interface-descriptors-ia32.cc
|
View
|
|
2 chunks |
+7 lines, -5 lines |
0 comments
|
Download
|
|
M |
src/interface-descriptors.h
|
View
|
|
5 chunks |
+6 lines, -12 lines |
0 comments
|
Download
|
|
M |
src/interface-descriptors.cc
|
View
|
|
1 chunk |
+0 lines, -20 lines |
0 comments
|
Download
|
|
M |
src/interpreter/bytecode-array-builder.h
|
View
|
|
2 chunks |
+0 lines, -7 lines |
1 comment
|
Download
|
|
M |
src/interpreter/bytecode-array-builder.cc
|
View
|
|
3 chunks |
+3 lines, -13 lines |
0 comments
|
Download
|
|
M |
src/interpreter/bytecode-generator.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
src/interpreter/bytecode-generator.cc
|
View
|
|
2 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
src/interpreter/bytecodes.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
src/interpreter/interpreter.cc
|
View
|
|
1 chunk |
+5 lines, -7 lines |
0 comments
|
Download
|
|
M |
src/mips/code-stubs-mips.cc
|
View
|
|
2 chunks |
+141 lines, -24 lines |
0 comments
|
Download
|
|
M |
src/mips/interface-descriptors-mips.cc
|
View
|
|
2 chunks |
+7 lines, -5 lines |
0 comments
|
Download
|
|
M |
src/mips64/code-stubs-mips64.cc
|
View
|
|
2 chunks |
+146 lines, -26 lines |
0 comments
|
Download
|
|
M |
src/mips64/interface-descriptors-mips64.cc
|
View
|
|
2 chunks |
+7 lines, -5 lines |
0 comments
|
Download
|
|
M |
src/parsing/parser.cc
|
View
|
|
1 chunk |
+5 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/runtime/runtime.h
|
View
|
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
|
M |
src/runtime/runtime-scopes.cc
|
View
|
|
3 chunks |
+16 lines, -45 lines |
0 comments
|
Download
|
|
M |
src/x64/code-stubs-x64.cc
|
View
|
|
2 chunks |
+152 lines, -30 lines |
0 comments
|
Download
|
|
M |
src/x64/interface-descriptors-x64.cc
|
View
|
|
2 chunks |
+7 lines, -5 lines |
0 comments
|
Download
|
|
M |
test/cctest/interpreter/test-bytecode-generator.cc
|
View
|
|
4 chunks |
+24 lines, -24 lines |
0 comments
|
Download
|
|
M |
test/unittests/compiler/js-typed-lowering-unittest.cc
|
View
|
|
6 chunks |
+9 lines, -9 lines |
0 comments
|
Download
|
|
M |
test/unittests/interpreter/bytecode-array-builder-unittest.cc
|
View
|
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
Total messages: 11 (5 generated)
|