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

Issue 1309243003: ES6: Array.prototype.slice and friends should use ToLength instead of ToUint32 (Closed)

Created:
5 years, 3 months ago by aperez
Modified:
5 years, 3 months ago
CC:
v8-dev, Yang
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

ES6: Array.prototype.slice and friends should use ToLength instead of ToUint32 Defines a new --harmony-tolength flag, and a ToLengthFlagged() runtime function, that is used where ES6 requires ToLength(), but a pre-ES6 conversion existed before. When the flag is disabled, the function uses TO_UINT32(), which is the pre-ES6 behaviour. When the flag enabled, the ES6-compliant ToLength() conversion is used. Based on a patch initially from Diego Pino <dpino@igalia.com>; BUG=v8:3087 LOG=Y Committed: https://crrev.com/d4e1299f1686ff55f9425d6b322c194a1968fe3f Cr-Commit-Position: refs/heads/master@{#30772}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Rebased with current Git master #

Patch Set 3 : Use a TO_LENGTH macro instead of the ToLengthFlagged function #

Total comments: 7

Patch Set 4 : Renamed TO_LENGTH → TO_LENGTH_OR_UINT32 #

Total comments: 2

Patch Set 5 : Fixed nit: use factory()->ToBoolean() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+246 lines, -23 lines) Patch
M src/array.js View 1 2 3 22 chunks +22 lines, -22 lines 0 comments Download
M src/bootstrapper.cc View 1 2 3 4 2 chunks +10 lines, -0 lines 0 comments Download
M src/flag-definitions.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/harmony-array.js View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/heap/heap.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/macros.py View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/runtime.js View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
A test/mjsunit/harmony/array-length.js View 1 chunk +208 lines, -0 lines 0 comments Download

Messages

Total messages: 45 (17 generated)
aperez
On 2015/08/31 20:00:14, aperez wrote: > mailto:aperez@igalia.com changed reviewers: > + mailto:arv@chromium.org, mailto:dslomov@chromium.org, mailto:rossberg@chromium.org, > ...
5 years, 3 months ago (2015-08-31 20:01:14 UTC) #2
aperez
On 2015/08/31 20:00:14, aperez wrote: > mailto:aperez@igalia.com changed reviewers: > + mailto:arv@chromium.org, mailto:dslomov@chromium.org, mailto:rossberg@chromium.org, > ...
5 years, 3 months ago (2015-08-31 20:01:21 UTC) #3
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1309243003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1309243003/1
5 years, 3 months ago (2015-09-08 07:02:41 UTC) #6
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_linux_dbg on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_dbg/builds/8466) v8_linux_nodcheck_rel on ...
5 years, 3 months ago (2015-09-08 07:03:26 UTC) #8
Camillo Bruni
Doesn't merge right now, I think due to some merge artifacts (I added two comments). ...
5 years, 3 months ago (2015-09-08 07:10:34 UTC) #9
Camillo Bruni
https://codereview.chromium.org/1309243003/diff/1/src/runtime.js File src/runtime.js (right): https://codereview.chromium.org/1309243003/diff/1/src/runtime.js#newcode717 src/runtime.js:717: function ToLengthFlagged(arg) { I would create a TO_LENGTH macro ...
5 years, 3 months ago (2015-09-08 07:18:07 UTC) #10
aperez
On 2015/09/08 07:10:34, cbruni wrote: > Doesn't merge right now, I think due to some ...
5 years, 3 months ago (2015-09-08 20:43:45 UTC) #11
Camillo Bruni
On 2015/09/08 at 20:43:45, aperez wrote: > On 2015/09/08 07:10:34, cbruni wrote: > > Doesn't ...
5 years, 3 months ago (2015-09-08 20:52:56 UTC) #12
aperez
PTAL. I have uploaded an updated CL which uses a macro as suggested. That made ...
5 years, 3 months ago (2015-09-09 12:48:43 UTC) #13
Camillo Bruni
Probably fine like this... but I was just reminded that an earlier introduction of toLength ...
5 years, 3 months ago (2015-09-09 13:51:17 UTC) #14
aperez
Changed macro name, also removed the bogus patch hunks from the rebase. PTAL. https://codereview.chromium.org/1309243003/diff/40001/src/heap/heap.h File ...
5 years, 3 months ago (2015-09-09 18:20:45 UTC) #15
Camillo Bruni
lgtm lgmt Looks good :)
5 years, 3 months ago (2015-09-10 07:12:34 UTC) #16
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1309243003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1309243003/60001
5 years, 3 months ago (2015-09-10 08:00:04 UTC) #18
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 3 months ago (2015-09-10 08:26:00 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1309243003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1309243003/60001
5 years, 3 months ago (2015-09-10 08:38:01 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1309243003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1309243003/60001
5 years, 3 months ago (2015-09-10 08:38:21 UTC) #26
commit-bot: I haz the power
Try jobs failed on following builders: v8_presubmit on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/5672)
5 years, 3 months ago (2015-09-10 08:40:54 UTC) #28
Dan Ehrenberg
lgtm Code looks good to me. I am still worried about performance though. Could you ...
5 years, 3 months ago (2015-09-10 17:46:05 UTC) #30
aperez
On 2015/09/10 17:46:05, Dan Ehrenberg wrote: > lgtm > > Code looks good to me. ...
5 years, 3 months ago (2015-09-14 20:51:34 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1309243003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1309243003/60001
5 years, 3 months ago (2015-09-15 09:28:36 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: v8_presubmit on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/5780)
5 years, 3 months ago (2015-09-15 09:32:28 UTC) #35
dehrenberg1
On 2015/09/15 09:32:28, commit-bot: I haz the power wrote: > Try jobs failed on following ...
5 years, 3 months ago (2015-09-16 16:15:51 UTC) #37
Michael Starzinger
LGTM (rubber-stamp for heap). https://codereview.chromium.org/1309243003/diff/60001/src/bootstrapper.cc File src/bootstrapper.cc (right): https://codereview.chromium.org/1309243003/diff/60001/src/bootstrapper.cc#newcode1857 src/bootstrapper.cc:1857: Handle<HeapObject> flag(FLAG_harmony_tolength ? heap()->true_value() nit: ...
5 years, 3 months ago (2015-09-16 16:21:33 UTC) #38
Michael Starzinger
LGTM (rubber-stamp for heap). https://codereview.chromium.org/1309243003/diff/60001/src/bootstrapper.cc File src/bootstrapper.cc (right): https://codereview.chromium.org/1309243003/diff/60001/src/bootstrapper.cc#newcode1857 src/bootstrapper.cc:1857: Handle<HeapObject> flag(FLAG_harmony_tolength ? heap()->true_value() nit: ...
5 years, 3 months ago (2015-09-16 16:21:33 UTC) #39
aperez
Fixed nit. Let's land this for good :) https://codereview.chromium.org/1309243003/diff/60001/src/bootstrapper.cc File src/bootstrapper.cc (right): https://codereview.chromium.org/1309243003/diff/60001/src/bootstrapper.cc#newcode1857 src/bootstrapper.cc:1857: Handle<HeapObject> ...
5 years, 3 months ago (2015-09-16 17:34:47 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1309243003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1309243003/80001
5 years, 3 months ago (2015-09-16 17:35:07 UTC) #43
commit-bot: I haz the power
Committed patchset #5 (id:80001)
5 years, 3 months ago (2015-09-16 18:01:44 UTC) #44
commit-bot: I haz the power
5 years, 3 months ago (2015-09-16 18:02:01 UTC) #45
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/d4e1299f1686ff55f9425d6b322c194a1968fe3f
Cr-Commit-Position: refs/heads/master@{#30772}

Powered by Google App Engine
This is Rietveld 408576698