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

Issue 2146293003: [builtins] implement Array.prototype.includes in TurboFan (Closed)

Created:
4 years, 5 months ago by caitp
Modified:
3 years, 9 months ago
CC:
danno, Jakob Kummerow, v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[builtins] implement Array.prototype.includes in TurboFan BUG=v8:5162 R=bmeurer@chromium.org, ishell@chromium.org Committed: https://crrev.com/a488b5d8eb111a4883dc400bd826d079420edd68 Cr-Commit-Position: refs/heads/master@{#38223}

Patch Set 1 #

Total comments: 5

Patch Set 2 : Things that were missed #

Patch Set 3 : More robust "init_k" block #

Patch Set 4 : fix IsComparisonOpcode #

Total comments: 5

Patch Set 5 : Refactor based on bmeurer comments #

Total comments: 1

Patch Set 6 : fixit #

Total comments: 8

Patch Set 7 : try lots of tight loops #

Total comments: 7

Patch Set 8 : fix number equality checks #

Patch Set 9 : move to builtins-array.cc and add indexed interceptor checks #

Total comments: 35

Patch Set 10 : Add a basic impl in ElementsAccessor, cleanup %ArrayIncludes_Slow, lots of new tests #

Total comments: 24

Patch Set 11 #

Patch Set 12 : fix some things, rebase, rename some variables in TF, etc #

Total comments: 18

Patch Set 13 : Experiment: measure benefit of TF stub #

Patch Set 14 : Address cbruni's comments, lots more tests, fixed some bugs #

Patch Set 15 : debug fixup #

Total comments: 12

Patch Set 16 : Move impl to builtins-array.cc, fix DictionaryElementsAccessor impl #

Patch Set 17 : More efficient version of the DICTIONARY_ELEMENTS fast case #

Patch Set 18 : - #

Patch Set 19 : Try to make MSVC happy #

Patch Set 20 : Fix BranchIfSimd128Equal #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+1886 lines, -152 lines) Patch
M src/builtins/builtins.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +2 lines, -0 lines 0 comments Download
M src/builtins/builtins-array.cc View 1 2 3 4 5 6 7 8 9 10 11 13 4 chunks +484 lines, -16 lines 0 comments Download
M src/code-stub-assembler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +16 lines, -0 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 19 1 chunk +210 lines, -0 lines 0 comments Download
M src/code-stubs.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +2 lines, -72 lines 0 comments Download
M src/compiler/code-assembler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -1 line 0 comments Download
M src/compiler/code-assembler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -1 line 0 comments Download
M src/compiler/raw-machine-assembler.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -2 lines 0 comments Download
M src/compiler/raw-machine-assembler.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -2 lines 0 comments Download
M src/elements.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +6 lines, -0 lines 0 comments Download
M src/elements.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 7 chunks +369 lines, -7 lines 0 comments Download
M src/factory.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +10 lines, -0 lines 0 comments Download
M src/js/array.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +1 line, -43 lines 0 comments Download
M src/js/typedarray.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +23 lines, -3 lines 0 comments Download
M src/objects.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +3 lines, -0 lines 0 comments Download
M src/objects-inl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +14 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 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 3 chunks +104 lines, -4 lines 0 comments Download
A test/mjsunit/es7/array-includes-receiver.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +634 lines, -0 lines 2 comments Download

Messages

Total messages: 69 (28 generated)
caitp
PTAL at your leisure, this isn't really urgent or anything I haven't yet run the ...
4 years, 5 months ago (2016-07-14 18:01:18 UTC) #6
Benedikt Meurer
Approach looks promising. First round of comments. https://codereview.chromium.org/2146293003/diff/60001/src/builtins/builtins.cc File src/builtins/builtins.cc (right): https://codereview.chromium.org/2146293003/diff/60001/src/builtins/builtins.cc#newcode398 src/builtins/builtins.cc:398: tagged_n.Bind(assembler->CallStub(call_to_integer, context, ...
4 years, 5 months ago (2016-07-15 04:50:36 UTC) #12
caitp
https://codereview.chromium.org/2146293003/diff/60001/src/builtins/builtins.cc File src/builtins/builtins.cc (right): https://codereview.chromium.org/2146293003/diff/60001/src/builtins/builtins.cc#newcode398 src/builtins/builtins.cc:398: tagged_n.Bind(assembler->CallStub(call_to_integer, context, start_from)); On 2016/07/15 04:50:35, Benedikt Meurer wrote: ...
4 years, 5 months ago (2016-07-15 05:56:05 UTC) #13
Benedikt Meurer
> The trouble is, for negative numbers that are less than -len, `k` is initialized ...
4 years, 5 months ago (2016-07-15 05:59:22 UTC) #14
caitp
On 2016/07/15 05:59:22, Benedikt Meurer wrote: > > The trouble is, for negative numbers that ...
4 years, 5 months ago (2016-07-15 16:33:30 UTC) #15
caitp
https://codereview.chromium.org/2146293003/diff/80001/src/code-stub-assembler.cc File src/code-stub-assembler.cc (right): https://codereview.chromium.org/2146293003/diff/80001/src/code-stub-assembler.cc#newcode478 src/code-stub-assembler.cc:478: BranchIf(CallRuntime(Runtime::kInlineStrictEqual, context, a, b), if_true, this was the problem ...
4 years, 5 months ago (2016-07-15 17:24:35 UTC) #16
Benedikt Meurer
Wow, nice explorative work, Caitlin. https://codereview.chromium.org/2146293003/diff/100001/src/builtins/builtins.cc File src/builtins/builtins.cc (right): https://codereview.chromium.org/2146293003/diff/100001/src/builtins/builtins.cc#newcode448 src/builtins/builtins.cc:448: Label loop_body(assembler, 2, You ...
4 years, 5 months ago (2016-07-15 17:59:55 UTC) #17
caitp
Thanks for the look --- I started implementing `BranchIfSimd128Equal()` in code-stub-assembler.cc before I saw the ...
4 years, 5 months ago (2016-07-15 22:11:17 UTC) #18
Benedikt Meurer
https://codereview.chromium.org/2146293003/diff/100001/src/builtins/builtins.cc File src/builtins/builtins.cc (right): https://codereview.chromium.org/2146293003/diff/100001/src/builtins/builtins.cc#newcode448 src/builtins/builtins.cc:448: Label loop_body(assembler, 2, Ah indeed, you also need to ...
4 years, 5 months ago (2016-07-16 12:40:28 UTC) #19
caitp
https://codereview.chromium.org/2146293003/diff/120001/src/builtins/builtins.cc File src/builtins/builtins.cc (right): https://codereview.chromium.org/2146293003/diff/120001/src/builtins/builtins.cc#newcode463 src/builtins/builtins.cc:463: assembler->Bind(&if_smiorobjects); There are lots of different tight loops here, ...
4 years, 5 months ago (2016-07-17 03:26:47 UTC) #20
Benedikt Meurer
https://codereview.chromium.org/2146293003/diff/120001/src/builtins/builtins.cc File src/builtins/builtins.cc (right): https://codereview.chromium.org/2146293003/diff/120001/src/builtins/builtins.cc#newcode463 src/builtins/builtins.cc:463: assembler->Bind(&if_smiorobjects); Awesome, I think this is the maximum you ...
4 years, 5 months ago (2016-07-17 06:03:18 UTC) #21
caitp
https://codereview.chromium.org/2146293003/diff/120001/src/code-stub-assembler.cc File src/code-stub-assembler.cc (right): https://codereview.chromium.org/2146293003/diff/120001/src/code-stub-assembler.cc#newcode606 src/code-stub-assembler.cc:606: Node* int32_zero = Int32Constant(0); On 2016/07/17 06:03:18, Benedikt Meurer ...
4 years, 5 months ago (2016-07-18 14:57:44 UTC) #22
caitp
https://codereview.chromium.org/2146293003/diff/120001/src/code-stub-assembler.cc File src/code-stub-assembler.cc (right): https://codereview.chromium.org/2146293003/diff/120001/src/code-stub-assembler.cc#newcode606 src/code-stub-assembler.cc:606: Node* int32_zero = Int32Constant(0); On 2016/07/18 14:57:44, caitp wrote: ...
4 years, 5 months ago (2016-07-18 14:59:06 UTC) #23
caitp
https://codereview.chromium.org/2146293003/diff/120001/src/builtins/builtins.cc File src/builtins/builtins.cc (right): https://codereview.chromium.org/2146293003/diff/120001/src/builtins/builtins.cc#newcode463 src/builtins/builtins.cc:463: assembler->Bind(&if_smiorobjects); On 2016/07/17 06:03:18, Benedikt Meurer wrote: > Awesome, ...
4 years, 5 months ago (2016-07-18 22:10:23 UTC) #24
Benedikt Meurer
> I had looked at adding a JSBuiltinReducer for ArrayIncludes, but it seems easier > ...
4 years, 5 months ago (2016-07-19 03:32:07 UTC) #25
Benedikt Meurer
Very nice work, another round of comments. Getting close to landable. Can you maybe some ...
4 years, 5 months ago (2016-07-19 03:53:19 UTC) #27
Camillo Bruni
what a beast!! :P Added some comments mostly to the C++ side of things, benedict ...
4 years, 5 months ago (2016-07-19 12:08:38 UTC) #28
caitp
Mostly clear. I have some other questions, though https://codereview.chromium.org/2146293003/diff/160001/src/builtins/builtins-array.cc File src/builtins/builtins-array.cc (right): https://codereview.chromium.org/2146293003/diff/160001/src/builtins/builtins-array.cc#newcode1337 src/builtins/builtins-array.cc:1337: &abort); ...
4 years, 5 months ago (2016-07-19 19:59:21 UTC) #29
Benedikt Meurer
Thanks, questions addressed (and pinged danno about the Label issue). https://codereview.chromium.org/2146293003/diff/160001/src/builtins/builtins-array.cc File src/builtins/builtins-array.cc (right): https://codereview.chromium.org/2146293003/diff/160001/src/builtins/builtins-array.cc#newcode1337 ...
4 years, 5 months ago (2016-07-20 03:55:01 UTC) #30
Camillo Bruni
Sorry for chiming in so late. I'd like to first see a full includes implementation ...
4 years, 5 months ago (2016-07-20 12:46:15 UTC) #31
caitp
https://codereview.chromium.org/2146293003/diff/160001/src/builtins/builtins-array.cc File src/builtins/builtins-array.cc (right): https://codereview.chromium.org/2146293003/diff/160001/src/builtins/builtins-array.cc#newcode1338 src/builtins/builtins-array.cc:1338: n.Bind(assembler->TruncateFloat64ToWord32(fp_n)); On 2016/07/20 03:55:01, Benedikt Meurer wrote: > It ...
4 years, 5 months ago (2016-07-20 16:07:55 UTC) #32
caitp
Updated + some questions for Camillo https://codereview.chromium.org/2146293003/diff/180001/src/builtins/builtins-array.cc File src/builtins/builtins-array.cc (left): https://codereview.chromium.org/2146293003/diff/180001/src/builtins/builtins-array.cc#oldcode58 src/builtins/builtins-array.cc:58: inline bool PrototypeHasNoElements(Isolate* ...
4 years, 5 months ago (2016-07-21 03:28:55 UTC) #33
Camillo Bruni
next round of comments and nits on the C++ part :). https://codereview.chromium.org/2146293003/diff/180001/src/elements.cc File src/elements.cc (right): ...
4 years, 5 months ago (2016-07-21 08:01:55 UTC) #34
caitp
bit more work on ElementsAccessor impl. https://codereview.chromium.org/2146293003/diff/180001/src/elements.cc File src/elements.cc (right): https://codereview.chromium.org/2146293003/diff/180001/src/elements.cc#newcode1848 src/elements.cc:1848: if (!value->IsNumber()) { ...
4 years, 5 months ago (2016-07-21 20:32:29 UTC) #35
danno
https://codereview.chromium.org/2146293003/diff/160001/src/builtins/builtins-array.cc File src/builtins/builtins-array.cc (right): https://codereview.chromium.org/2146293003/diff/160001/src/builtins/builtins-array.cc#newcode1337 src/builtins/builtins-array.cc:1337: &abort); On 2016/07/20 03:55:01, Benedikt Meurer wrote: > That ...
4 years, 5 months ago (2016-07-25 13:53:55 UTC) #37
caitp
+ Jakob (to hear an answer from a question asked on the bug). The newest ...
4 years, 4 months ago (2016-07-26 21:09:45 UTC) #38
Camillo Bruni
almost there, thanks for your patience! Added some more minor comments. https://codereview.chromium.org/2146293003/diff/220001/src/builtins/builtins.h File src/builtins/builtins.h (right): ...
4 years, 4 months ago (2016-07-28 12:57:29 UTC) #39
caitp
https://codereview.chromium.org/2146293003/diff/220001/src/elements.cc File src/elements.cc (right): https://codereview.chromium.org/2146293003/diff/220001/src/elements.cc#newcode474 src/elements.cc:474: uint32_t start_from, uint32_t length) { On 2016/07/28 12:57:29, Camillo ...
4 years, 4 months ago (2016-07-29 20:27:47 UTC) #40
Camillo Bruni
awesome job! I will do a final pass on monday morning so you can finally ...
4 years, 4 months ago (2016-07-30 06:56:56 UTC) #41
Camillo Bruni
LGTM with nits. https://codereview.chromium.org/2146293003/diff/280001/src/elements.cc File src/elements.cc (right): https://codereview.chromium.org/2146293003/diff/280001/src/elements.cc#newcode2003 src/elements.cc:2003: } bah, sucks that you can ...
4 years, 4 months ago (2016-08-01 07:23:47 UTC) #42
caitp
Done https://codereview.chromium.org/2146293003/diff/280001/src/elements.cc File src/elements.cc (right): https://codereview.chromium.org/2146293003/diff/280001/src/elements.cc#newcode1485 src/elements.cc:1485: return false; Unfortunately, this doesn't work. The only ...
4 years, 4 months ago (2016-08-01 15:10:45 UTC) #43
Camillo Bruni
https://codereview.chromium.org/2146293003/diff/280001/src/elements.cc File src/elements.cc (right): https://codereview.chromium.org/2146293003/diff/280001/src/elements.cc#newcode1485 src/elements.cc:1485: return false; right. We already have a check HasAccessorsImpl() ...
4 years, 4 months ago (2016-08-01 15:37:04 UTC) #48
caitp
seems to be building and passing tests everywhere now. So, the last thing is the ...
4 years, 4 months ago (2016-08-01 16:44:55 UTC) #55
Benedikt Meurer
This is LGTM from me. I'd vote for not only keeping the TF version (which ...
4 years, 4 months ago (2016-08-01 17:31:06 UTC) #58
Dan Ehrenberg
Are there tests for a primitive receiver? Or for fewer arguments than expected? I don't ...
4 years, 4 months ago (2016-08-01 21:50:23 UTC) #60
caitp
On 2016/08/01 21:50:23, Dan Ehrenberg wrote: > Are there tests for a primitive receiver? Or ...
4 years, 4 months ago (2016-08-01 21:57:35 UTC) #61
caitp
On 2016/08/01 21:57:35, caitp wrote: > On 2016/08/01 21:50:23, Dan Ehrenberg wrote: > > Are ...
4 years, 4 months ago (2016-08-01 22:02:43 UTC) #62
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/2146293003/380001
4 years, 4 months ago (2016-08-01 22:17:25 UTC) #65
commit-bot: I haz the power
Committed patchset #20 (id:380001)
4 years, 4 months ago (2016-08-01 22:19:33 UTC) #66
commit-bot: I haz the power
Patchset 20 (id:??) landed as https://crrev.com/a488b5d8eb111a4883dc400bd826d079420edd68 Cr-Commit-Position: refs/heads/master@{#38223}
4 years, 4 months ago (2016-08-01 22:20:10 UTC) #68
Michael Achenbach
4 years, 4 months ago (2016-08-02 06:52:07 UTC) #69
Message was sent while issue was closed.
A revert of this CL (patchset #20 id:380001) has been created in
https://codereview.chromium.org/2202163002/ by machenbach@chromium.org.

The reason for reverting is: [Sheriff] Breaks:
https://build.chromium.org/p/client.v8.ports/builders/V8%20Arm%20-%20builder/....

Powered by Google App Engine
This is Rietveld 408576698