https://codereview.chromium.org/1132163011/diff/20001/src/harmony-typedarray.js
File src/harmony-typedarray.js (right):
https://codereview.chromium.org/1132163011/diff/20001/src/harmony-typedarray.js#newcode121
src/harmony-typedarray.js:121: var array = %_CallFunction(GlobalArray,
source, mapfn, thisArg, $arrayFrom);
On 2015/05/16 18:23:45, arv wrote:
Add todo. It would surely be better to not have a temporary array.
Can you do the $innerArrayFrom solution here too?
The problem is that, if the source is iterable, then we don't know its
length until we get all the way through it. So we have to iterate
through the whole thing, and then make a TypedArray of that length. I
don't really see an 'inner' part that I could pull out.
The only way I could see to speed this up would be to implement a
TypedVector (TypedArray supporting a push method) and execute 'from'
directly onto that. This would be a bit of work, and may or may not be
faster. I added a todo.
https://codereview.chromium.org/1132163011/diff/20001/test/mjsunit/harmony/typedarray-from.js
File test/mjsunit/harmony/typedarray-from.js (right):
https://codereview.chromium.org/1132163011/diff/20001/test/mjsunit/harmony/typedarray-from.js#newcode64
test/mjsunit/harmony/typedarray-from.js:64: var kSet = new Set([1, 2,
3]);
On 2015/05/16 18:23:45, arv wrote:
kSet -> set
Done.
https://codereview.chromium.org/1132163011/diff/20001/test/mjsunit/harmony/typedarray-from.js#newcode103
test/mjsunit/harmony/typedarray-from.js:103: called = true;
On 2015/05/16 18:23:45, arv wrote:
another way to do this is to use a counter and then assert that it is
1
afterwards.
Done. Thanks, that's cleaner.
https://codereview.chromium.org/1132163011/diff/20001/test/mjsunit/harmony/typedarray-from.js#newcode124
test/mjsunit/harmony/typedarray-from.js:124:
On 2015/05/16 18:23:45, arv wrote:
remove empty line
Done.
https://codereview.chromium.org/1132163011/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.