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

Issue 2465253011: Fastpath some spread-call desugaring. (Closed)

Created:
4 years, 1 month ago by petermarshall
Modified:
4 years, 1 month ago
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Fastpath some spread-call desugaring. Avoid using the iterator for arrays with fast elements where the iterator has not been modified. Only deals with the case where there is a single spread argument. Improves the six-speed "spread" benchmark to 1.5x slower than baseline es5 implementation, compared to 19x slower previously. BUG=v8:5511 Committed: https://crrev.com/a63eeb485a2667e9d8d0660969baeb1f242d0979 Cr-Commit-Position: refs/heads/master@{#40998}

Patch Set 1 #

Patch Set 2 : Clean up wrong function name, add args length check #

Patch Set 3 : Store the default iterator on the native context #

Patch Set 4 : Don't install spread on global obj #

Total comments: 6

Patch Set 5 : Add two failing tests that test obserable side effects #

Patch Set 6 : Add array iterator protector and guard on it #

Patch Set 7 : Inalidate protector on .next(), too #

Patch Set 8 : Move helper to a runtime function #

Total comments: 1

Patch Set 9 : Don't look up the iterator, or the prototype of the ArrayIterator, because we statically know what … #

Patch Set 10 : Change dupe test name #

Patch Set 11 : Rebase to master #

Total comments: 5

Patch Set 12 : Check spread has initial array proto; add test for it #

Patch Set 13 : Rename array protector valid values #

Total comments: 2

Patch Set 14 : Use functions for testing initial_* objects #

Total comments: 1

Patch Set 15 : Fix some more constant naming from rebase #

Patch Set 16 : Add test case for holey smi arrays #

Patch Set 17 : Update test for observable behaviour on holey arrays, fix in code" #

Patch Set 18 : rebase #

Patch Set 19 : rename constant #

Total comments: 4

Patch Set 20 : Handles double arrays too #

Unified diffs Side-by-side diffs Delta from patch set Stats (+244 lines, -48 lines) Patch
M src/bootstrapper.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +5 lines, -0 lines 0 comments Download
M src/builtins/builtins-array.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +3 lines, -3 lines 0 comments Download
M src/code-stub-assembler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +3 lines, -3 lines 0 comments Download
M src/contexts.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -0 lines 0 comments Download
M src/crankshaft/arm/lithium-codegen-arm.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -2 lines 0 comments Download
M src/crankshaft/arm64/lithium-codegen-arm64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -2 lines 0 comments Download
M src/crankshaft/ia32/lithium-codegen-ia32.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -2 lines 0 comments Download
M src/crankshaft/mips/lithium-codegen-mips.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -2 lines 0 comments Download
M src/crankshaft/mips64/lithium-codegen-mips64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -2 lines 0 comments Download
M src/crankshaft/ppc/lithium-codegen-ppc.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -2 lines 0 comments Download
M src/crankshaft/s390/lithium-codegen-s390.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -2 lines 0 comments Download
M src/crankshaft/x64/lithium-codegen-x64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -2 lines 0 comments Download
M src/crankshaft/x87/lithium-codegen-x87.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -2 lines 0 comments Download
M src/heap/heap.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M src/heap/heap.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +10 lines, -6 lines 0 comments Download
M src/isolate.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +4 lines, -2 lines 0 comments Download
M src/isolate.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +15 lines, -8 lines 0 comments Download
M src/isolate-inl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +9 lines, -4 lines 0 comments Download
M src/lookup.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -1 line 0 comments Download
M src/lookup.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +5 lines, -0 lines 0 comments Download
M src/parsing/parser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -1 line 0 comments Download
M src/runtime/runtime.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -1 line 0 comments Download
M src/runtime/runtime-array.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +43 lines, -0 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/CallRuntime.golden View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M test/mjsunit/es6/spread-call.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +118 lines, -0 lines 0 comments Download

Messages

Total messages: 108 (79 generated)
petermarshall
PTAL :). WASM sanitizer failures are being fixed in https://codereview.chromium.org/2476643003
4 years, 1 month ago (2016-11-08 10:00:53 UTC) #20
Yang
https://codereview.chromium.org/2465253011/diff/60001/src/bootstrapper.cc File src/bootstrapper.cc (right): https://codereview.chromium.org/2465253011/diff/60001/src/bootstrapper.cc#newcode2439 src/bootstrapper.cc:2439: Builtins::kSpreadIterablePrepare, 1, false); Why do we need this? I ...
4 years, 1 month ago (2016-11-08 14:08:41 UTC) #21
petermarshall
Benedikt could you take a look? I added a protector cell for the array iterator, ...
4 years, 1 month ago (2016-11-10 12:19:20 UTC) #39
Benedikt Meurer
Fist comment (as per offline discussion) :-) We need to either rename this protector or ...
4 years, 1 month ago (2016-11-10 12:32:59 UTC) #41
petermarshall
Now checks the map of %ArrayIterator%.prototype against the initial one. I think we properly handle ...
4 years, 1 month ago (2016-11-11 10:34:23 UTC) #54
caitp
https://codereview.chromium.org/2465253011/diff/200001/src/lookup.cc File src/lookup.cc (right): https://codereview.chromium.org/2465253011/diff/200001/src/lookup.cc#newcode201 src/lookup.cc:201: } this is a very different case from the ...
4 years, 1 month ago (2016-11-11 16:19:17 UTC) #56
Yang
On 2016/11/11 16:19:17, caitp wrote: > https://codereview.chromium.org/2465253011/diff/200001/src/lookup.cc > File src/lookup.cc (right): > > https://codereview.chromium.org/2465253011/diff/200001/src/lookup.cc#newcode201 > ...
4 years, 1 month ago (2016-11-14 10:16:56 UTC) #57
Yang
https://codereview.chromium.org/2465253011/diff/200001/src/heap/heap.cc File src/heap/heap.cc (right): https://codereview.chromium.org/2465253011/diff/200001/src/heap/heap.cc#newcode2844 src/heap/heap.cc:2844: handle(Smi::FromInt(Isolate::kArrayProtectorValid), isolate())); Can we name kArrayProtectorValid to kProtectorValid? https://codereview.chromium.org/2465253011/diff/200001/src/lookup.h ...
4 years, 1 month ago (2016-11-14 10:17:20 UTC) #58
petermarshall
Ok we now check if the array has the original prototype that we actually spent ...
4 years, 1 month ago (2016-11-14 12:52:50 UTC) #64
Yang
https://codereview.chromium.org/2465253011/diff/240001/src/runtime/runtime-array.cc File src/runtime/runtime-array.cc (right): https://codereview.chromium.org/2465253011/diff/240001/src/runtime/runtime-array.cc#newcode654 src/runtime/runtime-array.cc:654: Object* original_proto = *isolate->initial_array_prototype(); this unnecessarily wraps the context ...
4 years, 1 month ago (2016-11-14 12:59:01 UTC) #65
Yang
On 2016/11/14 12:59:01, Yang wrote: > https://codereview.chromium.org/2465253011/diff/240001/src/runtime/runtime-array.cc > File src/runtime/runtime-array.cc (right): > > https://codereview.chromium.org/2465253011/diff/240001/src/runtime/runtime-array.cc#newcode654 > ...
4 years, 1 month ago (2016-11-14 12:59:13 UTC) #66
petermarshall
Updated for Yang's comment https://codereview.chromium.org/2465253011/diff/240001/src/runtime/runtime-array.cc File src/runtime/runtime-array.cc (right): https://codereview.chromium.org/2465253011/diff/240001/src/runtime/runtime-array.cc#newcode654 src/runtime/runtime-array.cc:654: Object* original_proto = *isolate->initial_array_prototype(); On ...
4 years, 1 month ago (2016-11-14 13:37:19 UTC) #69
Yang
On 2016/11/14 13:37:19, petermarshall wrote: > Updated for Yang's comment > > https://codereview.chromium.org/2465253011/diff/240001/src/runtime/runtime-array.cc > File ...
4 years, 1 month ago (2016-11-14 13:43:48 UTC) #70
petermarshall
Benedikt, you mentioned a few patches ago that there might be an issue with holey ...
4 years, 1 month ago (2016-11-14 13:44:13 UTC) #71
Benedikt Meurer
please rebase on caitlins CL and address comment with test case. https://codereview.chromium.org/2465253011/diff/260001/src/runtime/runtime-array.cc File src/runtime/runtime-array.cc (right): ...
4 years, 1 month ago (2016-11-14 18:58:24 UTC) #72
petermarshall
I added a test for holey arrays with a getter on the prototype (testArrayPrototypeHasHoleGetter). The ...
4 years, 1 month ago (2016-11-15 10:14:33 UTC) #77
Benedikt Meurer
The breakage happens when the element access modifies %ArrayIterator%.prototype.next, which is not covered currently.
4 years, 1 month ago (2016-11-15 10:16:17 UTC) #78
petermarshall
Ahh OK, the GetElement calls in CreateListFromArrayLike are observable but happen after all of our ...
4 years, 1 month ago (2016-11-15 10:51:17 UTC) #79
Yang
lgtm with comment https://codereview.chromium.org/2465253011/diff/360001/src/runtime/runtime-array.cc File src/runtime/runtime-array.cc (right): https://codereview.chromium.org/2465253011/diff/360001/src/runtime/runtime-array.cc#newcode661 src/runtime/runtime-array.cc:661: if (array_kind == FAST_SMI_ELEMENTS || array_kind ...
4 years, 1 month ago (2016-11-15 13:12:03 UTC) #91
Benedikt Meurer
LGTM once comments addressed. https://codereview.chromium.org/2465253011/diff/360001/src/runtime/runtime-array.cc File src/runtime/runtime-array.cc (right): https://codereview.chromium.org/2465253011/diff/360001/src/runtime/runtime-array.cc#newcode661 src/runtime/runtime-array.cc:661: if (array_kind == FAST_SMI_ELEMENTS || ...
4 years, 1 month ago (2016-11-15 13:13:46 UTC) #92
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/2465253011/380001
4 years, 1 month ago (2016-11-15 14:13:03 UTC) #95
commit-bot: I haz the power
Try jobs failed on following builders: v8_presubmit on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/28564)
4 years, 1 month ago (2016-11-15 14:17:13 UTC) #97
petermarshall
Daniel could you PTAL as parsing.cc owner https://codereview.chromium.org/2465253011/diff/360001/src/runtime/runtime-array.cc File src/runtime/runtime-array.cc (right): https://codereview.chromium.org/2465253011/diff/360001/src/runtime/runtime-array.cc#newcode661 src/runtime/runtime-array.cc:661: if (array_kind ...
4 years, 1 month ago (2016-11-15 14:24:49 UTC) #99
vogelheim
lgtm for src/parsing/...
4 years, 1 month ago (2016-11-15 14:26:36 UTC) #100
petermarshall
Ulan, could you PTAL as src/heap/* owner?
4 years, 1 month ago (2016-11-15 14:28:41 UTC) #102
ulan
heap lgtm
4 years, 1 month ago (2016-11-15 14:34:01 UTC) #103
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/2465253011/380001
4 years, 1 month ago (2016-11-15 14:35:06 UTC) #105
commit-bot: I haz the power
Committed patchset #20 (id:380001)
4 years, 1 month ago (2016-11-15 14:41:36 UTC) #106
commit-bot: I haz the power
4 years, 1 month ago (2016-11-17 22:34:24 UTC) #108
Message was sent while issue was closed.
Patchset 20 (id:??) landed as
https://crrev.com/a63eeb485a2667e9d8d0660969baeb1f242d0979
Cr-Commit-Position: refs/heads/master@{#40998}

Powered by Google App Engine
This is Rietveld 408576698