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

Issue 1181903003: Allow TypedArrays to be initialized with iterables (Closed)

Created:
5 years, 6 months ago by Dan Ehrenberg
Modified:
5 years, 6 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

Allow TypedArrays to be initialized with iterables In ES6, the TypedArray constructor can be called either with an array-like object or an iterable. The code previously handled only array-like objects. This patch switches to supporting iterables while throwing in an optimization to make Arrays get allocated the old way, without an extra copy. BUG=v8:4090 LOG=Y R=adamk Committed: https://crrev.com/40420f67e7fb029a1379882f95023afaa19fa7a0 Cr-Commit-Position: refs/heads/master@{#29031}

Patch Set 1 #

Total comments: 3

Patch Set 2 : Fix iterator multiple lookup issue #

Total comments: 3

Patch Set 3 : fix iteration #

Total comments: 2

Patch Set 4 : clean up how iteration works #

Total comments: 4

Patch Set 5 : null proto for iterator #

Total comments: 8

Patch Set 6 : Fixes from arv's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+63 lines, -1 line) Patch
M src/typedarray.js View 1 2 3 4 5 3 chunks +26 lines, -1 line 0 comments Download
M test/mjsunit/harmony/typedarrays.js View 1 1 chunk +37 lines, -0 lines 0 comments Download

Messages

Total messages: 22 (4 generated)
Dan Ehrenberg
5 years, 6 months ago (2015-06-12 00:42:29 UTC) #1
adamk
https://codereview.chromium.org/1181903003/diff/1/src/typedarray.js File src/typedarray.js (right): https://codereview.chromium.org/1181903003/diff/1/src/typedarray.js#newcode154 src/typedarray.js:154: // twice. Currently, that's fine, but it'll be observable ...
5 years, 6 months ago (2015-06-12 00:57:08 UTC) #2
caitp (gmail)
https://codereview.chromium.org/1181903003/diff/1/src/typedarray.js File src/typedarray.js (right): https://codereview.chromium.org/1181903003/diff/1/src/typedarray.js#newcode154 src/typedarray.js:154: // twice. Currently, that's fine, but it'll be observable ...
5 years, 6 months ago (2015-06-12 01:11:33 UTC) #3
Dan Ehrenberg
Fixed the issue in the new version. https://codereview.chromium.org/1181903003/diff/1/src/typedarray.js File src/typedarray.js (right): https://codereview.chromium.org/1181903003/diff/1/src/typedarray.js#newcode154 src/typedarray.js:154: // twice. ...
5 years, 6 months ago (2015-06-12 02:42:22 UTC) #4
caitp (gmail)
https://codereview.chromium.org/1181903003/diff/20001/src/typedarray.js File src/typedarray.js (right): https://codereview.chromium.org/1181903003/diff/20001/src/typedarray.js#newcode140 src/typedarray.js:140: list.push(current.value); Sorry to nitpick, but this is missing a ...
5 years, 6 months ago (2015-06-12 02:47:22 UTC) #5
arv (Not doing code reviews)
https://codereview.chromium.org/1181903003/diff/20001/src/typedarray.js File src/typedarray.js (right): https://codereview.chromium.org/1181903003/diff/20001/src/typedarray.js#newcode139 src/typedarray.js:139: while (!current.done) { The main benefit of using for-of ...
5 years, 6 months ago (2015-06-12 10:04:50 UTC) #7
Dan Ehrenberg
Good catch, thanks https://codereview.chromium.org/1181903003/diff/20001/src/typedarray.js File src/typedarray.js (right): https://codereview.chromium.org/1181903003/diff/20001/src/typedarray.js#newcode140 src/typedarray.js:140: list.push(current.value); On 2015/06/12 02:47:21, caitp wrote: ...
5 years, 6 months ago (2015-06-12 15:30:54 UTC) #8
adamk
https://codereview.chromium.org/1181903003/diff/40001/src/typedarray.js File src/typedarray.js (right): https://codereview.chromium.org/1181903003/diff/40001/src/typedarray.js#newcode140 src/typedarray.js:140: if (!IS_OBJECT(current)) { I think you want IS_SPEC_OBJECT here. ...
5 years, 6 months ago (2015-06-12 18:06:46 UTC) #9
Dan Ehrenberg
https://codereview.chromium.org/1181903003/diff/40001/src/typedarray.js File src/typedarray.js (right): https://codereview.chromium.org/1181903003/diff/40001/src/typedarray.js#newcode140 src/typedarray.js:140: if (!IS_OBJECT(current)) { On 2015/06/12 18:06:45, adamk wrote: > ...
5 years, 6 months ago (2015-06-13 00:11:41 UTC) #10
adamk
https://codereview.chromium.org/1181903003/diff/60001/src/typedarray.js File src/typedarray.js (right): https://codereview.chromium.org/1181903003/diff/60001/src/typedarray.js#newcode139 src/typedarray.js:139: newIterable[symbolIterator] = function() { return iterator; }; Sadly this ...
5 years, 6 months ago (2015-06-13 00:17:27 UTC) #11
caitp (gmail)
https://codereview.chromium.org/1181903003/diff/60001/src/typedarray.js File src/typedarray.js (right): https://codereview.chromium.org/1181903003/diff/60001/src/typedarray.js#newcode139 src/typedarray.js:139: newIterable[symbolIterator] = function() { return iterator; }; On 2015/06/13 ...
5 years, 6 months ago (2015-06-13 00:49:24 UTC) #13
adamk
https://codereview.chromium.org/1181903003/diff/60001/src/typedarray.js File src/typedarray.js (right): https://codereview.chromium.org/1181903003/diff/60001/src/typedarray.js#newcode139 src/typedarray.js:139: newIterable[symbolIterator] = function() { return iterator; }; On 2015/06/13 ...
5 years, 6 months ago (2015-06-13 00:50:45 UTC) #14
Dan Ehrenberg
https://codereview.chromium.org/1181903003/diff/60001/src/typedarray.js File src/typedarray.js (right): https://codereview.chromium.org/1181903003/diff/60001/src/typedarray.js#newcode139 src/typedarray.js:139: newIterable[symbolIterator] = function() { return iterator; }; On 2015/06/13 ...
5 years, 6 months ago (2015-06-13 05:16:30 UTC) #15
arv (Not doing code reviews)
LGTM https://codereview.chromium.org/1181903003/diff/80001/src/typedarray.js File src/typedarray.js (right): https://codereview.chromium.org/1181903003/diff/80001/src/typedarray.js#newcode138 src/typedarray.js:138: var newIterable = {__proto__: null}; var newIterable = ...
5 years, 6 months ago (2015-06-15 15:53:19 UTC) #16
Dan Ehrenberg
https://codereview.chromium.org/1181903003/diff/80001/src/typedarray.js File src/typedarray.js (right): https://codereview.chromium.org/1181903003/diff/80001/src/typedarray.js#newcode138 src/typedarray.js:138: var newIterable = {__proto__: null}; On 2015/06/15 15:53:19, arv ...
5 years, 6 months ago (2015-06-15 18:14:20 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1181903003/100001
5 years, 6 months ago (2015-06-15 18:14:39 UTC) #20
commit-bot: I haz the power
Committed patchset #6 (id:100001)
5 years, 6 months ago (2015-06-15 18:54:33 UTC) #21
commit-bot: I haz the power
5 years, 6 months ago (2015-06-15 18:54:51 UTC) #22
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/40420f67e7fb029a1379882f95023afaa19fa7a0
Cr-Commit-Position: refs/heads/master@{#29031}

Powered by Google App Engine
This is Rietveld 408576698