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

Issue 2405253006: [builtins] implement Array.prototype[@@iterator] in TFJ builtins (Closed)

Created:
4 years, 2 months ago by caitp
Modified:
4 years, 2 months ago
CC:
Hannes Payer (out of office), ulan, v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[builtins] implement Array.prototype[@@iterator] in TFJ builtins Implements the variations of CreateArrayIterator() in TFJ builtins (ArrayPrototypeValues, ArrayPrototypeEntries and ArrayPrototypeKeys), and provides two new Object types with numerous maps which identify certain behaviours, which will be useful for inlining. Removes src/js/array-iterator.js entirely Also adds support for printing Symbol literals inserted by the Parser during desugaring when FLAG_print_builtin_ast is set to true. BUG=v8:5388 R=bmeurer@chromium.org, cbruni@chromium.org TBR=ulan@chromium.org Committed: https://crrev.com/86d0dd362f627a7831b042d4fe8baa121c976fc4 Cr-Commit-Position: refs/heads/master@{#40373}

Patch Set 1 #

Total comments: 29

Patch Set 2 : V1 #

Total comments: 1

Patch Set 3 : V1 rebased :) #

Patch Set 4 : revert unneeded prologue.js changes #

Total comments: 1

Patch Set 5 : revert incorrect test262.status changes #

Patch Set 6 : remove apparently redundant var bindings and fix other bugs #

Total comments: 11

Patch Set 7 : and fix Context::array_values_iterator() #

Patch Set 8 : rebase and get tests passing #

Total comments: 4

Patch Set 9 : add array_iterator_protector, and check array_protector in holey fast arrays #

Total comments: 5

Patch Set 10 : speedups that probably still pass tests #

Patch Set 11 : fix JSArrayIteratorVerify() #

Total comments: 25

Patch Set 12 : latest round #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1537 lines, -185 lines) Patch
M BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -1 line 0 comments Download
M src/ast/ast-types.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +37 lines, -0 lines 0 comments Download
M src/ast/prettyprinter.cc View 1 chunk +12 lines, -0 lines 0 comments Download
M src/bootstrapper.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +96 lines, -0 lines 0 comments Download
M src/builtins/builtins.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +14 lines, -0 lines 0 comments Download
M src/builtins/builtins-array.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +519 lines, -0 lines 0 comments Download
M src/builtins/builtins-typedarray.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +76 lines, -9 lines 0 comments Download
M src/code-stub-assembler.h View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +31 lines, -0 lines 0 comments Download
M src/code-stub-assembler.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +374 lines, -0 lines 0 comments Download
M src/compiler/types.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +37 lines, -0 lines 0 comments Download
M src/contexts.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +72 lines, -2 lines 0 comments Download
M src/heap-symbols.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -0 lines 0 comments Download
M src/heap/objects-visiting.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +37 lines, -0 lines 0 comments Download
M src/js/array.js View 6 4 chunks +10 lines, -1 line 0 comments Download
D src/js/array-iterator.js View 1 chunk +0 lines, -168 lines 0 comments Download
M src/objects.h View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +120 lines, -0 lines 0 comments Download
M src/objects-body-descriptors-inl.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +37 lines, -0 lines 0 comments Download
M src/objects-debug.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +48 lines, -0 lines 0 comments Download
M src/objects-inl.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +11 lines, -0 lines 0 comments Download
M src/runtime/runtime-array.cc View 1 9 1 chunk +4 lines, -0 lines 0 comments Download
M src/v8.gyp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -1 line 0 comments Download
M test/test262/test262.status View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +0 lines, -3 lines 0 comments Download

Messages

Total messages: 89 (43 generated)
caitp
If possible, it would be nice to get a look at this so far (but ...
4 years, 2 months ago (2016-10-13 00:13:36 UTC) #1
Benedikt Meurer
First round of comments. +yangguo@ for bootstrapping Array stuff. https://codereview.chromium.org/2405253006/diff/1/src/builtins/builtins-array.cc File src/builtins/builtins-array.cc (right): https://codereview.chromium.org/2405253006/diff/1/src/builtins/builtins-array.cc#newcode2071 src/builtins/builtins-array.cc:2071: ...
4 years, 2 months ago (2016-10-13 05:07:20 UTC) #3
Yang
https://codereview.chromium.org/2405253006/diff/1/src/builtins/builtins-array.cc File src/builtins/builtins-array.cc (right): https://codereview.chromium.org/2405253006/diff/1/src/builtins/builtins-array.cc#newcode2088 src/builtins/builtins-array.cc:2088: Node* receiver = assembler->Parameter(0); On 2016/10/13 05:07:19, Benedikt Meurer ...
4 years, 2 months ago (2016-10-13 13:52:37 UTC) #4
caitp
https://codereview.chromium.org/2405253006/diff/1/src/builtins/builtins-array.cc File src/builtins/builtins-array.cc (right): https://codereview.chromium.org/2405253006/diff/1/src/builtins/builtins-array.cc#newcode2088 src/builtins/builtins-array.cc:2088: Node* receiver = assembler->Parameter(0); On 2016/10/13 13:52:37, Yang wrote: ...
4 years, 2 months ago (2016-10-13 16:12:58 UTC) #5
caitp
I've added the TypedArray stuff, seems to be working pretty nicely and passes some previously ...
4 years, 2 months ago (2016-10-13 22:32:44 UTC) #12
caitp
https://codereview.chromium.org/2405253006/diff/60001/test/test262/test262.status File test/test262/test262.status (left): https://codereview.chromium.org/2405253006/diff/60001/test/test262/test262.status#oldcode138 test/test262/test262.status:138: 'built-ins/TypedArrays/internals/DefineOwnProperty/detached-buffer': [FAIL], Oop, these removals are wrong (I only ...
4 years, 2 months ago (2016-10-13 22:39:42 UTC) #13
caitp
On 2016/10/13 22:39:42, caitp wrote: > https://codereview.chromium.org/2405253006/diff/60001/test/test262/test262.status > File test/test262/test262.status (left): > > https://codereview.chromium.org/2405253006/diff/60001/test/test262/test262.status#oldcode138 > ...
4 years, 2 months ago (2016-10-14 03:22:43 UTC) #22
Benedikt Meurer
https://codereview.chromium.org/2405253006/diff/1/src/builtins/builtins-array.cc File src/builtins/builtins-array.cc (right): https://codereview.chromium.org/2405253006/diff/1/src/builtins/builtins-array.cc#newcode2362 src/builtins/builtins-array.cc:2362: &allocate_array_iterator, &allocate_typed_array_iterator); What I'm saying is you need to ...
4 years, 2 months ago (2016-10-14 03:46:51 UTC) #23
caitp
https://codereview.chromium.org/2405253006/diff/100001/src/builtins/builtins-array.cc File src/builtins/builtins-array.cc (right): https://codereview.chromium.org/2405253006/diff/100001/src/builtins/builtins-array.cc#newcode2193 src/builtins/builtins-array.cc:2193: assembler->GotoIf(assembler->Word32Equal( On 2016/10/14 03:46:50, Benedikt Meurer wrote: > What ...
4 years, 2 months ago (2016-10-14 03:57:15 UTC) #24
Benedikt Meurer
https://codereview.chromium.org/2405253006/diff/100001/src/builtins/builtins-array.cc File src/builtins/builtins-array.cc (right): https://codereview.chromium.org/2405253006/diff/100001/src/builtins/builtins-array.cc#newcode2193 src/builtins/builtins-array.cc:2193: assembler->GotoIf(assembler->Word32Equal( As said, I'm perfectly happy if you say ...
4 years, 2 months ago (2016-10-14 04:11:18 UTC) #25
caitp
On 2016/10/14 04:11:18, Benedikt Meurer wrote: > https://codereview.chromium.org/2405253006/diff/100001/src/builtins/builtins-array.cc > File src/builtins/builtins-array.cc (right): > > https://codereview.chromium.org/2405253006/diff/100001/src/builtins/builtins-array.cc#newcode2193 ...
4 years, 2 months ago (2016-10-14 14:50:05 UTC) #32
caitp
On 2016/10/14 04:11:18, Benedikt Meurer wrote: > https://codereview.chromium.org/2405253006/diff/100001/src/builtins/builtins-array.cc > File src/builtins/builtins-array.cc (right): > > https://codereview.chromium.org/2405253006/diff/100001/src/builtins/builtins-array.cc#newcode2193 ...
4 years, 2 months ago (2016-10-14 14:51:38 UTC) #35
Benedikt Meurer
On 2016/10/14 14:51:38, caitp wrote: > On 2016/10/14 04:11:18, Benedikt Meurer wrote: > > > ...
4 years, 2 months ago (2016-10-14 17:11:34 UTC) #36
caitp
On 2016/10/14 17:11:34, Benedikt Meurer wrote: > On 2016/10/14 14:51:38, caitp wrote: > > On ...
4 years, 2 months ago (2016-10-14 17:42:03 UTC) #37
caitp
On 2016/10/14 17:42:03, caitp wrote: > On 2016/10/14 17:11:34, Benedikt Meurer wrote: > > On ...
4 years, 2 months ago (2016-10-14 18:03:29 UTC) #38
Benedikt Meurer
Thanks for prototyping this! Your intuition was right and the simpler implementation clearly beats the ...
4 years, 2 months ago (2016-10-14 18:28:49 UTC) #39
Benedikt Meurer
I'm looking at this simple benchmark: ============================================== "use strict"; function test(a) { for (var x ...
4 years, 2 months ago (2016-10-14 18:46:45 UTC) #40
caitp
On 2016/10/14 18:46:45, Benedikt Meurer wrote: > I'm looking at this simple benchmark: > > ...
4 years, 2 months ago (2016-10-14 18:48:37 UTC) #41
Benedikt Meurer
You need to do the holey cases separately, as you also need to check the ...
4 years, 2 months ago (2016-10-14 19:04:05 UTC) #42
Benedikt Meurer
https://codereview.chromium.org/2405253006/diff/140001/src/builtins/builtins-array.cc File src/builtins/builtins-array.cc (right): https://codereview.chromium.org/2405253006/diff/140001/src/builtins/builtins-array.cc#newcode2191 src/builtins/builtins-array.cc:2191: load_length_slow(assembler), did_get_length(assembler), The load_length_slow label should be marked as ...
4 years, 2 months ago (2016-10-14 19:13:11 UTC) #43
Benedikt Meurer
Ok, with some hacking I made the baseline version faster than the JS version. Here's ...
4 years, 2 months ago (2016-10-14 19:20:51 UTC) #44
caitp
On 2016/10/14 19:20:51, Benedikt Meurer wrote: > Ok, with some hacking I made the baseline ...
4 years, 2 months ago (2016-10-15 04:14:57 UTC) #45
Benedikt Meurer (Google)
On 2016/10/15 04:14:57, caitp wrote: > On 2016/10/14 19:20:51, Benedikt Meurer wrote: > > Ok, ...
4 years, 2 months ago (2016-10-15 08:43:22 UTC) #46
caitp
On 2016/10/15 08:43:22, Benedikt Meurer (Google) wrote: > On 2016/10/15 04:14:57, caitp wrote: > > ...
4 years, 2 months ago (2016-10-15 16:30:29 UTC) #47
Benedikt Meurer
You mean when you added the ArrayIteratorProtector? https://codereview.chromium.org/2405253006/diff/150001/src/builtins/builtins-array.cc File src/builtins/builtins-array.cc (right): https://codereview.chromium.org/2405253006/diff/150001/src/builtins/builtins-array.cc#newcode2168 src/builtins/builtins-array.cc:2168: assembler->GotoIf(assembler->WordEqual(array, assembler->UndefinedConstant()), ...
4 years, 2 months ago (2016-10-15 17:45:26 UTC) #48
Benedikt Meurer
https://codereview.chromium.org/2405253006/diff/150001/src/builtins/builtins-array.cc File src/builtins/builtins-array.cc (right): https://codereview.chromium.org/2405253006/diff/150001/src/builtins/builtins-array.cc#newcode2309 src/builtins/builtins-array.cc:2309: Callable less_than = CodeFactory::LessThan(assembler->isolate()); Ah, this is the issue: ...
4 years, 2 months ago (2016-10-15 17:49:20 UTC) #49
Benedikt Meurer
Otherwise I think your implementation looks good (modulo the undefined check that can still be ...
4 years, 2 months ago (2016-10-15 17:51:54 UTC) #50
Benedikt Meurer
Ok, I gave it a go. Very impressive, already down to 63ms in some cases, ...
4 years, 2 months ago (2016-10-15 18:07:01 UTC) #51
caitp
On 2016/10/15 18:07:01, Benedikt Meurer wrote: > Ok, I gave it a go. Very impressive, ...
4 years, 2 months ago (2016-10-16 01:49:24 UTC) #52
caitp
On 2016/10/16 01:49:24, caitp wrote: > On 2016/10/15 18:07:01, Benedikt Meurer wrote: > > Ok, ...
4 years, 2 months ago (2016-10-16 02:37:24 UTC) #55
Benedikt Meurer
On 2016/10/16 02:37:24, caitp wrote: > On 2016/10/16 01:49:24, caitp wrote: > > On 2016/10/15 ...
4 years, 2 months ago (2016-10-16 17:10:17 UTC) #62
caitp
On 2016/10/16 17:10:17, Benedikt Meurer wrote: > On 2016/10/16 02:37:24, caitp wrote: > > On ...
4 years, 2 months ago (2016-10-16 19:12:16 UTC) #63
Benedikt Meurer (Google)
On 2016/10/16 19:12:16, caitp wrote: > On 2016/10/16 17:10:17, Benedikt Meurer wrote: > > On ...
4 years, 2 months ago (2016-10-17 01:53:48 UTC) #64
Benedikt Meurer
Awesome, very nice! Thanks a lot. Final round of comments; LGTM once comments addressed. https://codereview.chromium.org/2405253006/diff/190001/src/builtins/builtins-array.cc ...
4 years, 2 months ago (2016-10-17 04:02:42 UTC) #65
caitp
https://codereview.chromium.org/2405253006/diff/190001/src/builtins/builtins-array.cc File src/builtins/builtins-array.cc (right): https://codereview.chromium.org/2405253006/diff/190001/src/builtins/builtins-array.cc#newcode2349 src/builtins/builtins-array.cc:2349: Node* elements = assembler->LoadElements(array); On 2016/10/17 04:02:42, Benedikt Meurer ...
4 years, 2 months ago (2016-10-17 13:18:11 UTC) #66
caitp
On 2016/10/17 13:18:11, caitp wrote: > ``` > V8 version 5.5.0 (candidate) > d8> var ...
4 years, 2 months ago (2016-10-17 13:26:37 UTC) #67
Benedikt Meurer (Google)
On 2016/10/17 13:26:37, caitp wrote: > On 2016/10/17 13:18:11, caitp wrote: > > ``` > ...
4 years, 2 months ago (2016-10-17 14:14:46 UTC) #68
Camillo Bruni
some drive-by comments https://codereview.chromium.org/2405253006/diff/190001/src/builtins/builtins-array.cc File src/builtins/builtins-array.cc (right): https://codereview.chromium.org/2405253006/diff/190001/src/builtins/builtins-array.cc#newcode2504 src/builtins/builtins-array.cc:2504: CodeStubAssembler::INTPTR_PARAMETERS); nit: You can use LoadContextElement() ...
4 years, 2 months ago (2016-10-17 14:56:40 UTC) #70
caitp
https://codereview.chromium.org/2405253006/diff/190001/src/builtins/builtins-array.cc File src/builtins/builtins-array.cc (right): https://codereview.chromium.org/2405253006/diff/190001/src/builtins/builtins-array.cc#newcode2082 src/builtins/builtins-array.cc:2082: Variable var_array(assembler, MachineRepresentation::kTagged); Would anyone object to my adding ...
4 years, 2 months ago (2016-10-17 18:11:37 UTC) #71
caitp
https://codereview.chromium.org/2405253006/diff/190001/src/builtins/builtins-array.cc File src/builtins/builtins-array.cc (right): https://codereview.chromium.org/2405253006/diff/190001/src/builtins/builtins-array.cc#newcode2093 src/builtins/builtins-array.cc:2093: assembler->Branch( On 2016/10/17 04:02:42, Benedikt Meurer wrote: > Use ...
4 years, 2 months ago (2016-10-18 00:16:50 UTC) #74
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/2405253006/210001
4 years, 2 months ago (2016-10-18 02:33:15 UTC) #79
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/26687)
4 years, 2 months ago (2016-10-18 02:37:46 UTC) #81
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/2405253006/210001
4 years, 2 months ago (2016-10-18 02:40:06 UTC) #84
commit-bot: I haz the power
Committed patchset #12 (id:210001)
4 years, 2 months ago (2016-10-18 02:42:51 UTC) #86
commit-bot: I haz the power
Patchset 12 (id:??) landed as https://crrev.com/86d0dd362f627a7831b042d4fe8baa121c976fc4 Cr-Commit-Position: refs/heads/master@{#40373}
4 years, 2 months ago (2016-10-18 02:43:27 UTC) #88
Michael Achenbach
4 years, 2 months ago (2016-10-18 06:45:13 UTC) #89
Message was sent while issue was closed.
This broke
https://build.chromium.org/p/client.v8.ports/builders/V8%20Mips%20-%20builder...
- no revert needed, but please fix asap

Powered by Google App Engine
This is Rietveld 408576698