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

Issue 2778623003: [typedarrays] Check detached buffer at start of typed array methods (Closed)

Created:
3 years, 9 months ago by Choongwoo Han
Modified:
3 years, 8 months ago
CC:
Tobias Tebbi, v8-reviews_googlegroups.com
Target Ref:
refs/heads/master
Project:
v8
Visibility:
Public.

Description

[typedarrays] Check detached buffer at start of typed array methods - Throw TypeError in ValidateTypedArray, matching JSC, SpiderMonkey and ChakraCore. - Validate typed arrays at start of each typed array prototype methods in src/js/typedarrays.js - Add tests to check detached buffers - Remove an unnecessary parameter of TypedArraySpeciesCreate in src/js/typedarrays.js - Standardize TypedArray.prototype.subarray - Update test262.status to pass detached buffer tests BUG=v8:4648, v8:4665, v8:4953 Review-Url: https://codereview.chromium.org/2778623003 Cr-Commit-Position: refs/heads/master@{#44357} Committed: https://chromium.googlesource.com/v8/v8/+/238d5b4453d9166aaddce76a5393514d977238d4

Patch Set 1 #

Total comments: 6

Patch Set 2 : Use inline IS_TYPEDARRAY #

Total comments: 6

Patch Set 3 : update tests #

Patch Set 4 : Add turbofan inline for neutered buffer checks #

Patch Set 5 : crankshaft inline #

Total comments: 4

Patch Set 6 : minor changes on ValidateTypedArray in js #

Patch Set 7 : rebase #

Total comments: 16

Patch Set 8 : apply comments #

Patch Set 9 : update test262.status #

Patch Set 10 : pass test262 for subarray #

Unified diffs Side-by-side diffs Delta from patch set Stats (+262 lines, -98 lines) Patch
M src/builtins/builtins-typedarray.cc View 1 2 3 4 5 6 4 chunks +2 lines, -7 lines 0 comments Download
M src/compiler/js-intrinsic-lowering.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M src/compiler/js-intrinsic-lowering.cc View 1 2 3 4 5 6 2 chunks +18 lines, -0 lines 0 comments Download
M src/crankshaft/hydrogen.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M src/crankshaft/hydrogen.cc View 1 2 3 4 5 6 7 1 chunk +17 lines, -0 lines 0 comments Download
M src/js/typedarray.js View 1 2 3 4 5 6 7 18 chunks +26 lines, -26 lines 0 comments Download
M src/objects-inl.h View 1 2 3 4 5 6 1 chunk +12 lines, -2 lines 0 comments Download
M src/runtime/runtime.h View 1 2 3 4 5 6 1 chunk +14 lines, -13 lines 0 comments Download
M src/runtime/runtime-typedarray.cc View 1 2 3 4 5 6 2 chunks +6 lines, -1 line 0 comments Download
M test/mjsunit/es6/typedarray-copywithin.js View 1 chunk +1 line, -3 lines 0 comments Download
M test/mjsunit/es6/typedarray-every.js View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M test/mjsunit/es6/typedarray-fill.js View 2 chunks +15 lines, -0 lines 0 comments Download
M test/mjsunit/es6/typedarray-find.js View 2 chunks +15 lines, -0 lines 0 comments Download
M test/mjsunit/es6/typedarray-findindex.js View 2 chunks +15 lines, -0 lines 0 comments Download
M test/mjsunit/es6/typedarray-foreach.js View 1 chunk +5 lines, -0 lines 0 comments Download
M test/mjsunit/es6/typedarray-indexing.js View 4 chunks +21 lines, -0 lines 0 comments Download
M test/mjsunit/es6/typedarray-iteration.js View 4 chunks +17 lines, -0 lines 0 comments Download
M test/mjsunit/es6/typedarray-reduce.js View 2 chunks +16 lines, -0 lines 0 comments Download
M test/mjsunit/es6/typedarray-reverse.js View 2 chunks +9 lines, -0 lines 0 comments Download
M test/mjsunit/es6/typedarray-slice.js View 1 2 3 4 5 6 2 chunks +15 lines, -0 lines 0 comments Download
M test/mjsunit/es6/typedarray-sort.js View 2 chunks +7 lines, -0 lines 0 comments Download
M test/mjsunit/es6/typedarray-tostring.js View 1 2 3 4 5 6 7 2 chunks +9 lines, -0 lines 0 comments Download
M test/mjsunit/regress/regress-353004.js View 1 2 1 chunk +8 lines, -8 lines 0 comments Download
D test/mjsunit/regress/regress-4665.js View 1 2 3 4 5 6 7 2 chunks +7 lines, -3 lines 0 comments Download
M test/test262/test262.status View 1 2 3 4 5 6 7 8 9 3 chunks +0 lines, -35 lines 0 comments Download

Messages

Total messages: 46 (22 generated)
Choongwoo Han
littledan@, adamk@, Could you take a look?
3 years, 9 months ago (2017-03-26 06:47:23 UTC) #3
adamk
My big concern here is performance due to the added runtime call, see below. https://codereview.chromium.org/2778623003/diff/1/src/builtins/builtins-typedarray.cc ...
3 years, 9 months ago (2017-03-27 19:48:20 UTC) #4
Camillo Bruni
Peter has been implementing TypedArray constructors in CSA, we could probably push the neutered checks ...
3 years, 9 months ago (2017-03-27 19:58:14 UTC) #6
Choongwoo Han
I uploaded a patch again. please take another look. https://codereview.chromium.org/2778623003/diff/1/src/builtins/builtins-typedarray.cc File src/builtins/builtins-typedarray.cc (left): https://codereview.chromium.org/2778623003/diff/1/src/builtins/builtins-typedarray.cc#oldcode50 src/builtins/builtins-typedarray.cc:50: ...
3 years, 8 months ago (2017-03-28 09:50:58 UTC) #7
Dan Ehrenberg
I don't quite understand why this version should be any faster. It looks like it's ...
3 years, 8 months ago (2017-03-28 19:39:28 UTC) #8
Choongwoo Han
The main bottleneck of the previous version was to convert from String to CString, so ...
3 years, 8 months ago (2017-03-29 05:36:55 UTC) #9
Choongwoo Han
Inlining WasNeutered Done. Overhead: 733.9846 / 720.6404 = 1.0185171411427945, when I ran the above benchmark ...
3 years, 8 months ago (2017-03-29 12:04:10 UTC) #10
adamk
Peter, what are your thoughts here?
3 years, 8 months ago (2017-03-29 22:46:46 UTC) #11
petermarshall
On 2017/03/29 at 22:46:46, adamk wrote: > Peter, what are your thoughts here? I think ...
3 years, 8 months ago (2017-03-30 08:54:40 UTC) #12
adamk
This looks much better to me with the neutered check inlined, +bmeurer for compiler/OWNERS. https://codereview.chromium.org/2778623003/diff/80001/src/js/typedarray.js ...
3 years, 8 months ago (2017-03-30 18:58:32 UTC) #14
Choongwoo Han
https://codereview.chromium.org/2778623003/diff/80001/src/js/typedarray.js File src/js/typedarray.js (right): https://codereview.chromium.org/2778623003/diff/80001/src/js/typedarray.js#newcode76 src/js/typedarray.js:76: function ValidateTypedArray(array, method) { On 2017/03/30 18:58:32, adamk wrote: ...
3 years, 8 months ago (2017-03-31 00:39:43 UTC) #15
Benedikt Meurer
LGTM on compiler
3 years, 8 months ago (2017-03-31 03:54:08 UTC) #16
Camillo Bruni
LGTM with nits. https://codereview.chromium.org/2778623003/diff/120001/src/js/typedarray.js File src/js/typedarray.js (right): https://codereview.chromium.org/2778623003/diff/120001/src/js/typedarray.js#newcode404 src/js/typedarray.js:404: ValidateTypedArray(this, "TypeArray.prototype.filter"); nit: %TypedArray%.prototype.filter https://codereview.chromium.org/2778623003/diff/120001/src/js/typedarray.js#newcode506 src/js/typedarray.js:506: ...
3 years, 8 months ago (2017-04-03 08:18:14 UTC) #17
Camillo Bruni
and please wait for an LGTM from littledan
3 years, 8 months ago (2017-04-03 08:18:39 UTC) #18
Camillo Bruni
https://codereview.chromium.org/2778623003/diff/120001/src/crankshaft/hydrogen.cc File src/crankshaft/hydrogen.cc (right): https://codereview.chromium.org/2778623003/diff/120001/src/crankshaft/hydrogen.cc#newcode9930 src/crankshaft/hydrogen.cc:9930: DCHECK(expr->arguments()->length() == 1); nit: DHECK_EQ(...)
3 years, 8 months ago (2017-04-03 08:19:24 UTC) #19
Choongwoo Han
thanks https://codereview.chromium.org/2778623003/diff/120001/src/crankshaft/hydrogen.cc File src/crankshaft/hydrogen.cc (right): https://codereview.chromium.org/2778623003/diff/120001/src/crankshaft/hydrogen.cc#newcode9930 src/crankshaft/hydrogen.cc:9930: DCHECK(expr->arguments()->length() == 1); On 2017/04/03 08:19:23, Camillo Bruni ...
3 years, 8 months ago (2017-04-03 08:42:29 UTC) #20
Dan Ehrenberg
lgtm Thanks so much for coming in and implementing this fix! Added a short note ...
3 years, 8 months ago (2017-04-03 11:46:50 UTC) #35
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/2778623003/180001
3 years, 8 months ago (2017-04-04 03:47:10 UTC) #38
commit-bot: I haz the power
Committed patchset #10 (id:180001) as https://chromium.googlesource.com/v8/v8/+/238d5b4453d9166aaddce76a5393514d977238d4
3 years, 8 months ago (2017-04-04 03:48:57 UTC) #41
Michael Achenbach
A revert of this CL (patchset #10 id:180001) has been created in https://codereview.chromium.org/2793233003/ by machenbach@chromium.org. ...
3 years, 8 months ago (2017-04-04 08:00:38 UTC) #42
Dan Ehrenberg
On 2017/04/04 08:00:38, Michael Achenbach wrote: > A revert of this CL (patchset #10 id:180001) ...
3 years, 8 months ago (2017-04-04 10:10:37 UTC) #43
Choongwoo Han
On 2017/04/04 10:10:37, Dan Ehrenberg wrote: > On 2017/04/04 08:00:38, Michael Achenbach wrote: > > ...
3 years, 8 months ago (2017-04-04 15:05:24 UTC) #44
Dan Ehrenberg
On 2017/04/04 15:05:24, Choongwoo Han wrote: > On 2017/04/04 10:10:37, Dan Ehrenberg wrote: > > ...
3 years, 8 months ago (2017-04-04 17:24:22 UTC) #45
Benedikt Meurer
3 years, 8 months ago (2017-04-26 05:58:34 UTC) #46
Message was sent while issue was closed.
LGTM on compiler

Powered by Google App Engine
This is Rietveld 408576698