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

Issue 919703003: WIP: Implement ES6 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

WIP: Implement ES6 Spread-calls Superceded by https://crrev.com/938443002 BUG=v8:3018 R= LOG=N

Patch Set 1 : AssignmentExpressions are not spreadable, add cctests for parsing #

Total comments: 6

Patch Set 2 : Add tests for bad rest/spread cases #

Patch Set 3 : Flag calls as spread calls in parser, error on spread intrinsics/construct calls #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+610 lines, -58 lines) Patch
M src/ast.h View 1 2 8 chunks +61 lines, -1 line 0 comments Download
M src/ast.cc View 1 chunk +50 lines, -0 lines 0 comments Download
M src/ast-numbering.cc View 1 chunk +10 lines, -0 lines 0 comments Download
M src/ast-this-access-visitor.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M src/bailout-reason.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/code.h View 1 chunk +0 lines, -3 lines 0 comments Download
M src/code-stubs.h View 3 chunks +12 lines, -4 lines 0 comments Download
M src/compiler/ast-graph-builder.cc View 1 chunk +14 lines, -0 lines 2 comments Download
M src/compiler/ast-loop-assignment-analyzer.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M src/full-codegen.h View 1 chunk +6 lines, -0 lines 0 comments Download
M src/full-codegen.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M src/hydrogen.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M src/ic/ic.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/ic/ic.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M src/ic/ic-state.h View 2 chunks +5 lines, -2 lines 0 comments Download
M src/ic/ic-state.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M src/messages.js View 1 2 1 chunk +4 lines, -1 line 0 comments Download
M src/parser.h View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M src/parser.cc View 1 2 2 chunks +10 lines, -9 lines 0 comments Download
M src/preparser.h View 1 2 13 chunks +63 lines, -8 lines 0 comments Download
M src/preparser.cc View 1 2 1 chunk +9 lines, -1 line 0 comments Download
M src/prettyprinter.cc View 3 chunks +20 lines, -0 lines 0 comments Download
M src/typing.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M src/x64/code-stubs-x64.cc View 7 chunks +40 lines, -15 lines 0 comments Download
M src/x64/codegen-x64.h View 2 chunks +1 line, -2 lines 0 comments Download
M src/x64/full-codegen-x64.cc View 2 chunks +68 lines, -7 lines 1 comment Download
M test/cctest/test-parsing.cc View 1 1 chunk +46 lines, -0 lines 0 comments Download
A test/mjsunit/harmony/spread-call.js View 1 chunk +149 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (4 generated)
caitp (gmail)
Prototype implementation --- tests are missing method spread-calls (because they were failing pretty badly), but ...
5 years, 10 months ago (2015-02-11 16:31:33 UTC) #1
arv (Not doing code reviews)
Looks like a good start https://codereview.chromium.org/919703003/diff/40001/src/ast.h File src/ast.h (right): https://codereview.chromium.org/919703003/diff/40001/src/ast.h#newcode1921 src/ast.h:1921: HasSpreadArgumentsField::encode(HasSpreadArguments(arguments))) { Maybe have ...
5 years, 10 months ago (2015-02-12 21:41:34 UTC) #5
caitp (gmail)
I was going to add a flag after doing a bit more work prototyping it, ...
5 years, 10 months ago (2015-02-12 21:58:54 UTC) #6
Michael Starzinger
I have questions ... https://codereview.chromium.org/919703003/diff/80001/src/compiler/ast-graph-builder.cc File src/compiler/ast-graph-builder.cc (right): https://codereview.chromium.org/919703003/diff/80001/src/compiler/ast-graph-builder.cc#newcode2236 src/compiler/ast-graph-builder.cc:2236: VisitForValue(expr->result_value()); I am not sure ...
5 years, 10 months ago (2015-02-16 19:58:58 UTC) #8
Michael Starzinger
https://codereview.chromium.org/919703003/diff/80001/src/x64/full-codegen-x64.cc File src/x64/full-codegen-x64.cc (right): https://codereview.chromium.org/919703003/diff/80001/src/x64/full-codegen-x64.cc#newcode2923 src/x64/full-codegen-x64.cc:2923: DoSpreadArgument(e->AsSpreadOperation(), rax); The $rax register here will most likely ...
5 years, 10 months ago (2015-02-16 20:11:27 UTC) #9
caitp (gmail)
https://codereview.chromium.org/919703003/diff/80001/src/compiler/ast-graph-builder.cc File src/compiler/ast-graph-builder.cc (right): https://codereview.chromium.org/919703003/diff/80001/src/compiler/ast-graph-builder.cc#newcode2236 src/compiler/ast-graph-builder.cc:2236: VisitForValue(expr->result_value()); On 2015/02/16 19:58:58, Michael Starzinger wrote: > I ...
5 years, 10 months ago (2015-02-16 21:41:51 UTC) #10
Michael Starzinger
On 2015/02/16 21:41:51, caitp wrote: > https://codereview.chromium.org/919703003/diff/80001/src/compiler/ast-graph-builder.cc > File src/compiler/ast-graph-builder.cc (right): > > https://codereview.chromium.org/919703003/diff/80001/src/compiler/ast-graph-builder.cc#newcode2236 > ...
5 years, 10 months ago (2015-02-16 22:08:44 UTC) #11
titzer
On 2015/02/16 22:08:44, Michael Starzinger wrote: > On 2015/02/16 21:41:51, caitp wrote: > > > ...
5 years, 10 months ago (2015-02-17 08:49:50 UTC) #12
caitp (gmail)
5 years, 10 months ago (2015-02-17 23:36:16 UTC) #13
On 2015/02/17 08:49:50, titzer wrote:
> On 2015/02/16 22:08:44, Michael Starzinger wrote:
> > On 2015/02/16 21:41:51, caitp wrote:
> > >
> >
>
https://codereview.chromium.org/919703003/diff/80001/src/compiler/ast-graph-b...
> > > File src/compiler/ast-graph-builder.cc (right):
> > > 
> > >
> >
>
https://codereview.chromium.org/919703003/diff/80001/src/compiler/ast-graph-b...
> > > src/compiler/ast-graph-builder.cc:2236:
VisitForValue(expr->result_value());
> > > On 2015/02/16 19:58:58, Michael Starzinger wrote:
> > > > I am not sure how this is supposed to work in the end. But if I
understand
> > > > correctly then the operand stack size in full-codegen is not statically
> > known
> > > > within the loop, because each iteration over the loop pushes one element
> in
> > > the
> > > > operand stack.
> > > > 
> > > > In TurboFan (as well as in Crankshaft for that matter) the environment
is
> a
> > > > static simulation of the operand stack (similar to an abstract
> > > interpretation).
> > > > But here the operand stack cannot be simulated.
> > > 
> > > I don't think I ever finished the AstGraphBuilder portion, so I wouldn't
pay
> > > much attention to it, it probably doesn't make sense.
> > > 
> > > for now, maybe it makes more sense to just desugar spread calls into
> > > Function.apply() as suggested previously.
> > 
> > +1 on desugaring to Function.apply()
> > 
> > Short-term it will be slower than using full-codegen's operand stack to
store
> > the argument values, because they need to be stored into the heap (i.e.
> > allocation plus write-barrier and all). But long-term it would give us more
> > freedom to find one common approach to optimize both spread-calls and
> > Function.apply without being restricted to a specific operand stack layout
in
> > full-codegen. Just my two cents.
> > 
> > Making variable-sized operand stacks work with the deoptimizer would be a
real
> > pain I think.
> 
> not lgtm,
> 
> We discussed this a bit this morning and we think that this could be more
easily
> done with a runtime call that uses an internal array for arguments,
Array.splice
> and Function.apply. That would be slower, but would be platform independent
and
> much easier to reason about.

There's an alternative version at https://codereview.chromium.org/938443002/
which basically does that

Powered by Google App Engine
This is Rietveld 408576698