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

Issue 938443002: [es6] implement spread calls (Closed)

Created:
5 years, 10 months ago by caitp (gmail)
Modified:
5 years, 8 months ago
CC:
v8-dev
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[es6] implement spread calls BUG=v8:3018 R= LOG=N Committed: https://crrev.com/74c381221c93253bbee513aa2539d93269303b8b Cr-Commit-Position: refs/heads/master@{#27714}

Patch Set 1 #

Patch Set 2 : Add construct support, clean out some gunk #

Total comments: 23

Patch Set 3 : Add DCHECK() to prevent intrinsics from being called with spread operator #

Total comments: 3

Patch Set 4 : Fix spread-call-new test typo, add failing test #

Patch Set 5 : Eagerly iterate spread expressions, make parser more complicated, simplify harmony-spread #

Total comments: 20

Patch Set 6 : Rebase (oops) + fix parser + more tests #

Patch Set 7 : Use push() (single-arg) rather than concat() #

Patch Set 8 : Use for-of loop in SpreadIterable() #

Patch Set 9 : Add more variations to evaluation order tests #

Total comments: 12

Patch Set 10 : Add comments / rename ApplyCall/ApplyConstruct / Extra tests #

Patch Set 11 : Rebase #

Patch Set 12 : Rebase + use Reflect* methods for this #

Patch Set 13 : Remove unneeded runtime functions #

Patch Set 14 : Remove --harmony-spread flag #

Total comments: 19

Patch Set 15 : Rebase + Remove hacks #

Patch Set 16 : Don't reuse AST nodes for method calls #

Patch Set 17 : Nits addressed #

Patch Set 18 : Add some perf tests (this stuff is slow ._.) #

Total comments: 7

Patch Set 19 : Add ports #

Patch Set 20 : Nits #

Total comments: 4

Patch Set 21 : rebase + clang-format #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+1423 lines, -144 lines) Patch
M BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +2 lines, -1 line 0 comments Download
M src/arm/full-codegen-arm.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +87 lines, -32 lines 0 comments Download
M src/arm64/full-codegen-arm64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +86 lines, -32 lines 0 comments Download
M src/ast.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +25 lines, -0 lines 0 comments Download
M src/ast-numbering.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +3 lines, -0 lines 0 comments Download
M src/ast-value-factory.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -0 lines 0 comments Download
M src/bootstrapper.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 5 chunks +6 lines, -2 lines 0 comments Download
M src/compiler/ast-graph-builder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +3 lines, -0 lines 0 comments Download
M src/compiler/ast-loop-assignment-analyzer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -0 lines 0 comments Download
M src/flag-definitions.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +2 lines, -1 line 0 comments Download
M src/full-codegen.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +7 lines, -1 line 0 comments Download
M src/full-codegen.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +6 lines, -0 lines 0 comments Download
A src/harmony-spread.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +33 lines, -0 lines 0 comments Download
M src/hydrogen.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +3 lines, -0 lines 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +84 lines, -30 lines 0 comments Download
M src/parser.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 3 chunks +36 lines, -0 lines 0 comments Download
M src/parser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 4 chunks +124 lines, -1 line 0 comments Download
M src/preparser.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 18 chunks +116 lines, -9 lines 0 comments Download
M src/preparser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +4 lines, -1 line 0 comments Download
M src/prettyprinter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +20 lines, -0 lines 0 comments Download
M src/runtime/runtime.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +2 lines, -1 line 0 comments Download
M src/runtime/runtime-classes.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +6 lines, -0 lines 0 comments Download
M src/typing.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +3 lines, -0 lines 0 comments Download
M src/x64/full-codegen-x64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 4 chunks +84 lines, -29 lines 0 comments Download
M test/cctest/test-parsing.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 3 chunks +50 lines, -1 line 0 comments Download
M test/js-perf-test/JSTests.json View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +15 lines, -0 lines 1 comment Download
A + test/js-perf-test/SpreadCalls/run.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +2 lines, -2 lines 0 comments Download
A test/js-perf-test/SpreadCalls/spreadcalls.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +77 lines, -0 lines 0 comments Download
A test/mjsunit/harmony/spread-call.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +374 lines, -0 lines 0 comments Download
A test/mjsunit/harmony/spread-call-new.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +62 lines, -0 lines 0 comments Download
A test/mjsunit/harmony/spread-call-new-class.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +92 lines, -0 lines 0 comments Download
M tools/gyp/v8.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 51 (11 generated)
caitp (gmail)
PTAL anyone interested It's not exactly a "desugaring", but it's the same sort of idea. ...
5 years, 10 months ago (2015-02-17 20:57:01 UTC) #1
arv (Not doing code reviews)
Very nice approach. Much easier to grasp and it allows us to make good progress ...
5 years, 10 months ago (2015-02-18 15:07:06 UTC) #3
caitp (gmail)
https://codereview.chromium.org/938443002/diff/20001/src/flag-definitions.h File src/flag-definitions.h (right): https://codereview.chromium.org/938443002/diff/20001/src/flag-definitions.h#newcode199 src/flag-definitions.h:199: V(harmony_spreadcalls, "harmony spread-calls") On 2015/02/18 15:07:05, arv wrote: > ...
5 years, 10 months ago (2015-02-18 15:32:08 UTC) #4
arv (Not doing code reviews)
https://codereview.chromium.org/938443002/diff/20001/src/flag-definitions.h File src/flag-definitions.h (right): https://codereview.chromium.org/938443002/diff/20001/src/flag-definitions.h#newcode199 src/flag-definitions.h:199: V(harmony_spreadcalls, "harmony spread-calls") On 2015/02/18 15:32:08, caitp wrote: > ...
5 years, 10 months ago (2015-02-18 15:36:54 UTC) #5
Michael Starzinger
https://codereview.chromium.org/938443002/diff/40001/test/mjsunit/harmony/spread-call.js File test/mjsunit/harmony/spread-call.js (right): https://codereview.chromium.org/938443002/diff/40001/test/mjsunit/harmony/spread-call.js#newcode3 test/mjsunit/harmony/spread-call.js:3: // found in the LICENSE file. What is the ...
5 years, 10 months ago (2015-02-18 19:41:25 UTC) #7
caitp (gmail)
https://codereview.chromium.org/938443002/diff/40001/test/mjsunit/harmony/spread-call.js File test/mjsunit/harmony/spread-call.js (right): https://codereview.chromium.org/938443002/diff/40001/test/mjsunit/harmony/spread-call.js#newcode3 test/mjsunit/harmony/spread-call.js:3: // found in the LICENSE file. On 2015/02/18 19:41:25, ...
5 years, 10 months ago (2015-02-23 14:46:49 UTC) #8
arv (Not doing code reviews)
https://codereview.chromium.org/938443002/diff/40001/test/mjsunit/harmony/spread-call.js File test/mjsunit/harmony/spread-call.js (right): https://codereview.chromium.org/938443002/diff/40001/test/mjsunit/harmony/spread-call.js#newcode3 test/mjsunit/harmony/spread-call.js:3: // found in the LICENSE file. On 2015/02/23 14:46:49, ...
5 years, 10 months ago (2015-02-23 15:06:53 UTC) #9
caitp (gmail)
On 2015/02/23 15:06:53, arv wrote: > https://codereview.chromium.org/938443002/diff/40001/test/mjsunit/harmony/spread-call.js > File test/mjsunit/harmony/spread-call.js (right): > > https://codereview.chromium.org/938443002/diff/40001/test/mjsunit/harmony/spread-call.js#newcode3 > ...
5 years, 10 months ago (2015-02-23 15:09:28 UTC) #10
caitp (gmail)
On 2015/02/23 15:09:28, caitp wrote: > On 2015/02/23 15:06:53, arv wrote: > > > https://codereview.chromium.org/938443002/diff/40001/test/mjsunit/harmony/spread-call.js ...
5 years, 10 months ago (2015-02-23 17:24:42 UTC) #11
arv (Not doing code reviews)
https://codereview.chromium.org/938443002/diff/80001/src/harmony-spread.js File src/harmony-spread.js (right): https://codereview.chromium.org/938443002/diff/80001/src/harmony-spread.js#newcode12 src/harmony-spread.js:12: var array = (new InternalArray()).concat(%_Arguments(0)); Why not Push. concat ...
5 years, 10 months ago (2015-02-23 17:55:56 UTC) #12
rossberg
https://codereview.chromium.org/938443002/diff/80001/src/bootstrapper.cc File src/bootstrapper.cc (right): https://codereview.chromium.org/938443002/diff/80001/src/bootstrapper.cc#newcode1619 src/bootstrapper.cc:1619: EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_spreadcalls) Why do we need a separate flag? https://codereview.chromium.org/938443002/diff/80001/src/harmony-spread.js ...
5 years, 10 months ago (2015-02-24 16:22:47 UTC) #14
caitp (gmail)
https://codereview.chromium.org/938443002/diff/80001/src/bootstrapper.cc File src/bootstrapper.cc (right): https://codereview.chromium.org/938443002/diff/80001/src/bootstrapper.cc#newcode1619 src/bootstrapper.cc:1619: EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_spreadcalls) On 2015/02/24 16:22:46, rossberg wrote: > Why do ...
5 years, 10 months ago (2015-02-25 00:00:25 UTC) #15
rossberg
https://codereview.chromium.org/938443002/diff/80001/src/bootstrapper.cc File src/bootstrapper.cc (right): https://codereview.chromium.org/938443002/diff/80001/src/bootstrapper.cc#newcode1619 src/bootstrapper.cc:1619: EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_spreadcalls) On 2015/02/25 00:00:24, caitp wrote: > On 2015/02/24 ...
5 years, 10 months ago (2015-02-25 14:28:19 UTC) #16
caitp (gmail)
Thanks https://codereview.chromium.org/938443002/diff/80001/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/938443002/diff/80001/src/parser.cc#newcode5497 src/parser.cc:5497: int i = 0; On 2015/02/25 14:28:18, rossberg ...
5 years, 10 months ago (2015-02-25 14:49:09 UTC) #17
caitp (gmail)
On 2015/02/25 14:49:09, caitp wrote: > Thanks > > https://codereview.chromium.org/938443002/diff/80001/src/parser.cc > File src/parser.cc (right): > ...
5 years, 9 months ago (2015-03-23 21:46:33 UTC) #19
arv (Not doing code reviews)
Very nice https://codereview.chromium.org/938443002/diff/280001/src/harmony-spread.js File src/harmony-spread.js (right): https://codereview.chromium.org/938443002/diff/280001/src/harmony-spread.js#newcode32 src/harmony-spread.js:32: if (IS_NULL_OR_UNDEFINED(collection)) { Isn't this is already ...
5 years, 8 months ago (2015-03-30 22:19:50 UTC) #22
caitp (gmail)
https://codereview.chromium.org/938443002/diff/280001/src/harmony-spread.js File src/harmony-spread.js (right): https://codereview.chromium.org/938443002/diff/280001/src/harmony-spread.js#newcode32 src/harmony-spread.js:32: if (IS_NULL_OR_UNDEFINED(collection)) { On 2015/03/30 22:19:49, arv wrote: > ...
5 years, 8 months ago (2015-03-30 22:38:12 UTC) #23
Dmitry Lomov (no reviews)
My biggest concern is IsSuperFlag on CallRuntime node. Can you also provide a high-level explanation ...
5 years, 8 months ago (2015-03-31 10:09:43 UTC) #24
caitp (gmail)
On 2015/03/31 10:09:43, Dmitry Lomov (chromium) wrote: > My biggest concern is IsSuperFlag on CallRuntime ...
5 years, 8 months ago (2015-03-31 12:28:40 UTC) #25
caitp (gmail)
On 2015/03/31 12:28:40, caitp wrote: > On 2015/03/31 10:09:43, Dmitry Lomov (chromium) wrote: > > ...
5 years, 8 months ago (2015-03-31 12:45:16 UTC) #26
Dmitry Lomov (no reviews)
On 2015/03/31 12:28:40, caitp wrote: > On 2015/03/31 10:09:43, Dmitry Lomov (chromium) wrote: > > ...
5 years, 8 months ago (2015-03-31 12:59:30 UTC) #27
caitp (gmail)
On 2015/03/31 12:59:30, Dmitry Lomov (chromium) wrote: > Let us have special intrinsics %_CallWithSpread and ...
5 years, 8 months ago (2015-03-31 15:37:18 UTC) #28
caitp (gmail)
On 2015/03/31 15:37:18, caitp wrote: > On 2015/03/31 12:59:30, Dmitry Lomov (chromium) wrote: > > ...
5 years, 8 months ago (2015-03-31 16:01:10 UTC) #29
caitp (gmail)
On 2015/03/31 16:01:10, caitp wrote: > On 2015/03/31 15:37:18, caitp wrote: > > On 2015/03/31 ...
5 years, 8 months ago (2015-03-31 17:05:21 UTC) #31
arv (Not doing code reviews)
LGTM Please wait for dmitry or mstarzinger before CQing.
5 years, 8 months ago (2015-03-31 18:54:32 UTC) #33
caitp (gmail)
On 2015/03/31 18:54:32, arv wrote: > LGTM > > Please wait for dmitry or mstarzinger ...
5 years, 8 months ago (2015-03-31 19:00:27 UTC) #34
Dmitry Lomov (no reviews)
looks good, go ahead with platform ports! https://codereview.chromium.org/938443002/diff/380002/src/flag-definitions.h File src/flag-definitions.h (left): https://codereview.chromium.org/938443002/diff/380002/src/flag-definitions.h#oldcode237 src/flag-definitions.h:237: nit: restore ...
5 years, 8 months ago (2015-04-02 07:53:33 UTC) #35
Dmitry Lomov (no reviews)
https://codereview.chromium.org/938443002/diff/380002/src/hydrogen.cc File src/hydrogen.cc (right): https://codereview.chromium.org/938443002/diff/380002/src/hydrogen.cc#newcode11031 src/hydrogen.cc:11031: void HOptimizedGraphBuilder::VisitSpread(Spread* expr) { UNREACHABLE(); } One thing I ...
5 years, 8 months ago (2015-04-02 07:54:20 UTC) #36
caitp (gmail)
https://codereview.chromium.org/938443002/diff/380002/src/hydrogen.cc File src/hydrogen.cc (right): https://codereview.chromium.org/938443002/diff/380002/src/hydrogen.cc#newcode11031 src/hydrogen.cc:11031: void HOptimizedGraphBuilder::VisitSpread(Spread* expr) { UNREACHABLE(); } On 2015/04/02 07:54:20, ...
5 years, 8 months ago (2015-04-02 13:03:51 UTC) #37
caitp (gmail)
Ports are written, nits addressed https://codereview.chromium.org/938443002/diff/380002/src/harmony-spread.js File src/harmony-spread.js (right): https://codereview.chromium.org/938443002/diff/380002/src/harmony-spread.js#newcode14 src/harmony-spread.js:14: if (SpreadArguments) return; On ...
5 years, 8 months ago (2015-04-02 14:18:48 UTC) #38
arv (Not doing code reviews)
I'm also curious what your long term plan is? The desugaring is kind of heavy ...
5 years, 8 months ago (2015-04-02 15:19:33 UTC) #39
caitp (gmail)
On 2015/04/02 15:19:33, arv wrote: > I'm also curious what your long term plan is? ...
5 years, 8 months ago (2015-04-02 15:32:48 UTC) #40
titzer
On 2015/04/02 15:32:48, caitp wrote: > On 2015/04/02 15:19:33, arv wrote: > > I'm also ...
5 years, 8 months ago (2015-04-07 08:18:04 UTC) #41
Michael Starzinger
LGTM. Didn't look at the parser and only glimpsed over the test coverage. Sorry for ...
5 years, 8 months ago (2015-04-08 18:48:26 UTC) #42
arv (Not doing code reviews)
LGTM https://codereview.chromium.org/938443002/diff/450001/src/arm/full-codegen-arm.cc File src/arm/full-codegen-arm.cc (right): https://codereview.chromium.org/938443002/diff/450001/src/arm/full-codegen-arm.cc#newcode4617 src/arm/full-codegen-arm.cc:4617: // Assert: expr === CallRuntime("ReflectConstruct") DCHECK_EQ(expr->raw_name(), ...) https://codereview.chromium.org/938443002/diff/450001/src/compiler/ast-loop-assignment-analyzer.cc ...
5 years, 8 months ago (2015-04-08 18:58:59 UTC) #43
caitp (gmail)
thanks for the review, will land this tonight https://codereview.chromium.org/938443002/diff/450001/src/compiler/ast-loop-assignment-analyzer.cc File src/compiler/ast-loop-assignment-analyzer.cc (right): https://codereview.chromium.org/938443002/diff/450001/src/compiler/ast-loop-assignment-analyzer.cc#newcode198 src/compiler/ast-loop-assignment-analyzer.cc:198: void ...
5 years, 8 months ago (2015-04-08 19:02:54 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/938443002/470001
5 years, 8 months ago (2015-04-09 14:59:28 UTC) #47
commit-bot: I haz the power
Committed patchset #21 (id:470001)
5 years, 8 months ago (2015-04-09 19:37:22 UTC) #48
commit-bot: I haz the power
Patchset 21 (id:??) landed as https://crrev.com/74c381221c93253bbee513aa2539d93269303b8b Cr-Commit-Position: refs/heads/master@{#27714}
5 years, 8 months ago (2015-04-09 19:37:36 UTC) #49
Michael Achenbach
5 years, 8 months ago (2015-04-10 10:04:20 UTC) #51
Message was sent while issue was closed.
https://codereview.chromium.org/938443002/diff/470001/test/js-perf-test/JSTes...
File test/js-perf-test/JSTests.json (right):

https://codereview.chromium.org/938443002/diff/470001/test/js-perf-test/JSTes...
test/js-perf-test/JSTests.json:20: {"name": "Call-Sum"},
What is actually printed is (exemplified):
Call-SpreadCalls(Score): 123
CallMethod-SpreadCalls(Score): 123
CallNew-SpreadCalls(Score): 123

Therefore the perf runner fails to gather these results as it looks for e.g.
Call-Sum-SpreadCalls.

Repro:
make x64.release
tools/run_perf.py --arch x64 test/js-perf-test/JSTests.json

Powered by Google App Engine
This is Rietveld 408576698