Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(632)

Issue 2890023004: [turbofan] Avoid allocating rest parameters for spread calls. (Closed)

Created:
3 years, 7 months ago by Benedikt Meurer
Modified:
3 years, 7 months ago
Reviewers:
Jarin
CC:
v8-reviews_googlegroups.com, v8-mips-ports_googlegroups.com, v8-x87-ports_googlegroups.com, v8-ppc-ports_googlegroups.com
Target Ref:
refs/heads/master
Project:
v8
Visibility:
Public.

Description

[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

Patch Set 1 #

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

Messages

Total messages: 12 (7 generated)
Benedikt Meurer
3 years, 7 months ago (2017-05-18 05:58:20 UTC) #1
Jarin
lgtm Do we have test coverage for all the combinations of arguments counts and kinds? ...
3 years, 7 months ago (2017-05-18 07:01:06 UTC) #6
Benedikt Meurer
Sprinkled some UNREACHABLEs and the tests hit them.
3 years, 7 months ago (2017-05-18 07:30:03 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2890023004/1
3 years, 7 months ago (2017-05-18 07:30:20 UTC) #9
commit-bot: I haz the power
3 years, 7 months ago (2017-05-18 07:32:32 UTC) #12
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/v8/v8/+/bfa319e5d3f902e504c00af5607117d1eb5...

Powered by Google App Engine
This is Rietveld 408576698