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

Issue 2671233002: [typedarrays] move %TypedArray%.prototype.copyWithin to C++ (Closed)

Created:
3 years, 10 months ago by caitp
Modified:
3 years, 10 months ago
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[typedarrays] move %TypedArray%.prototype.copyWithin to C++ - Removes shared InnerArrayCopyWithin JS builtin from src/js/array.js - Implements %TypedArray%.prototype.copyWithin as a C++ builtin, which relies on std::memmove rather than accessing individual eleements. - Fixes the case where copyWithin is invoked on a TypedArray with a detached buffer. - Add tests to ensure that +/-Infinity (for all 3 parameters) is handled correctly by the algorithm The C++ version gets through the benchmark more than 25000 times as quickly as the JS implementation. BUG=v8:5925, v8:5929, v8:4648 R=cbruni@chromium.org, adamk@chromium.org, littledan@chromium.org Review-Url: https://codereview.chromium.org/2671233002 Cr-Commit-Position: refs/heads/master@{#42975} Committed: https://chromium.googlesource.com/v8/v8/+/0f1c626d556cbf84b0e572635eb803729f88cbb3

Patch Set 1 #

Patch Set 2 : alphabetize JSTests.json #

Total comments: 5

Patch Set 3 : nits + move ValidateTypedArray to a helper as it is likely to be reused later #

Total comments: 7

Patch Set 4 : Add Object::ToFiniteInt64 thing and some tests #

Patch Set 5 : version without changes to objects.h/objects-inl.h #

Patch Set 6 : make win32 happy #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+158 lines, -29 lines) Patch
M src/bootstrapper.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M src/builtins/builtins.h View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M src/builtins/builtins-typedarray.cc View 1 2 3 4 5 1 chunk +90 lines, -0 lines 2 comments Download
M src/js/array.js View 3 chunks +7 lines, -13 lines 0 comments Download
M src/js/typedarray.js View 4 chunks +0 lines, -14 lines 0 comments Download
M test/mjsunit/es6/typedarray-copywithin.js View 1 2 3 1 chunk +54 lines, -0 lines 0 comments Download
M test/test262/test262.status View 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 39 (25 generated)
caitp
PTAL when time allows, thanks. Also, if I should move this to gerrit, I can ...
3 years, 10 months ago (2017-02-06 01:32:02 UTC) #3
Benedikt Meurer
On 2017/02/06 01:32:02, caitp wrote: > PTAL when time allows, thanks. Also, if I should ...
3 years, 10 months ago (2017-02-06 03:06:44 UTC) #4
Benedikt Meurer
Nice, just couple of mostly nits. Thanks. https://codereview.chromium.org/2671233002/diff/20001/src/bootstrapper.cc File src/bootstrapper.cc (right): https://codereview.chromium.org/2671233002/diff/20001/src/bootstrapper.cc#newcode2489 src/bootstrapper.cc:2489: Builtins::kTypedArrayPrototypeCopyWithin, 2, ...
3 years, 10 months ago (2017-02-06 03:54:33 UTC) #6
caitp
https://codereview.chromium.org/2671233002/diff/20001/src/bootstrapper.cc File src/bootstrapper.cc (right): https://codereview.chromium.org/2671233002/diff/20001/src/bootstrapper.cc#newcode2489 src/bootstrapper.cc:2489: Builtins::kTypedArrayPrototypeCopyWithin, 2, false); On 2017/02/06 03:54:33, Benedikt Meurer wrote: ...
3 years, 10 months ago (2017-02-06 14:21:13 UTC) #9
caitp
On 2017/02/06 14:21:13, caitp wrote: > https://codereview.chromium.org/2671233002/diff/20001/src/bootstrapper.cc > File src/bootstrapper.cc (right): > > https://codereview.chromium.org/2671233002/diff/20001/src/bootstrapper.cc#newcode2489 > ...
3 years, 10 months ago (2017-02-06 14:31:00 UTC) #11
Benedikt Meurer
Almost there. LGTM once comment addressed. https://codereview.chromium.org/2671233002/diff/40001/src/builtins/builtins-typedarray.cc File src/builtins/builtins-typedarray.cc (right): https://codereview.chromium.org/2671233002/diff/40001/src/builtins/builtins-typedarray.cc#newcode209 src/builtins/builtins-typedarray.cc:209: int64_t relative = ...
3 years, 10 months ago (2017-02-06 14:35:23 UTC) #12
Camillo Bruni
lgtm https://codereview.chromium.org/2671233002/diff/40001/src/builtins/builtins-typedarray.cc File src/builtins/builtins-typedarray.cc (right): https://codereview.chromium.org/2671233002/diff/40001/src/builtins/builtins-typedarray.cc#newcode209 src/builtins/builtins-typedarray.cc:209: int64_t relative = static_cast<int64_t>(target_int->Number()); nit: only if you ...
3 years, 10 months ago (2017-02-06 14:43:35 UTC) #13
caitp
test + fix shortly https://codereview.chromium.org/2671233002/diff/40001/src/builtins/builtins-typedarray.cc File src/builtins/builtins-typedarray.cc (right): https://codereview.chromium.org/2671233002/diff/40001/src/builtins/builtins-typedarray.cc#newcode209 src/builtins/builtins-typedarray.cc:209: int64_t relative = static_cast<int64_t>(target_int->Number()); On ...
3 years, 10 months ago (2017-02-06 14:44:40 UTC) #14
caitp
https://codereview.chromium.org/2671233002/diff/40001/src/builtins/builtins-typedarray.cc File src/builtins/builtins-typedarray.cc (right): https://codereview.chromium.org/2671233002/diff/40001/src/builtins/builtins-typedarray.cc#newcode209 src/builtins/builtins-typedarray.cc:209: int64_t relative = static_cast<int64_t>(target_int->Number()); On 2017/02/06 14:43:35, Camillo Bruni ...
3 years, 10 months ago (2017-02-06 14:57:12 UTC) #17
caitp
https://codereview.chromium.org/2671233002/diff/40001/src/builtins/builtins-typedarray.cc File src/builtins/builtins-typedarray.cc (right): https://codereview.chromium.org/2671233002/diff/40001/src/builtins/builtins-typedarray.cc#newcode209 src/builtins/builtins-typedarray.cc:209: int64_t relative = static_cast<int64_t>(target_int->Number()); On 2017/02/06 14:35:23, Benedikt Meurer ...
3 years, 10 months ago (2017-02-06 16:27:53 UTC) #21
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/2671233002/100001
3 years, 10 months ago (2017-02-06 17:22:28 UTC) #33
commit-bot: I haz the power
Committed patchset #6 (id:100001) as https://chromium.googlesource.com/v8/v8/+/0f1c626d556cbf84b0e572635eb803729f88cbb3
3 years, 10 months ago (2017-02-06 17:45:23 UTC) #36
Choongwoo Han
https://codereview.chromium.org/2671233002/diff/100001/src/builtins/builtins-typedarray.cc File src/builtins/builtins-typedarray.cc (right): https://codereview.chromium.org/2671233002/diff/100001/src/builtins/builtins-typedarray.cc#newcode217 src/builtins/builtins-typedarray.cc:217: isolate, array, ValiadateTypedArray(isolate, args.receiver(), method)); Validation check in here ...
3 years, 10 months ago (2017-02-12 07:38:21 UTC) #38
Dan Ehrenberg
3 years, 10 months ago (2017-02-12 16:08:26 UTC) #39
Message was sent while issue was closed.
A revert of this CL (patchset #6 id:100001) has been created in
https://codereview.chromium.org/2693753002/ by littledan@chromium.org.

The reason for reverting is: Due to security issue described in review thread..

Powered by Google App Engine
This is Rietveld 408576698