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

Issue 1069883002: WIP SharedArrayBuffer implementation (Closed)

Created:
5 years, 8 months ago by binji
Modified:
5 years, 7 months ago
CC:
bradnelson, Paweł Hajdan Jr., sehr, v8-dev, Toon Verwaest
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

WIP SharedArrayBuffer implementation BUG=none R=jarin@chromium.org

Patch Set 1 #

Total comments: 10

Patch Set 2 : merge master #

Patch Set 3 : use enum instead of bool #

Patch Set 4 : Add feature flag #

Patch Set 5 : use map()->instance_type() for is_shared() #

Patch Set 6 : forgot to revert some stuff in objects.h #

Patch Set 7 : merge master #

Patch Set 8 : add mjsunit test (copied) and fix bugs #

Patch Set 9 : a few more tests #

Patch Set 10 : merge master #

Patch Set 11 : merge master #

Patch Set 12 : update MakeTypeError calls #

Total comments: 23

Patch Set 13 : feedback #

Patch Set 14 : add GetContents, other feedback #

Patch Set 15 : merge master #

Patch Set 16 : feedback, move is_shared -> JSArrayBufferView #

Patch Set 17 : merge master #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1284 lines, -490 lines) Patch
M BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +3 lines, -1 line 0 comments Download
M include/v8.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 7 chunks +454 lines, -3 lines 0 comments Download
M src/accessors.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +2 lines, -0 lines 0 comments Download
M src/api.h View 1 2 3 4 5 6 4 chunks +46 lines, -0 lines 0 comments Download
M src/api.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 12 chunks +214 lines, -25 lines 0 comments Download
M src/bootstrapper.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 6 chunks +51 lines, -25 lines 0 comments Download
M src/contexts.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +47 lines, -0 lines 0 comments Download
M src/d8.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +4 lines, -0 lines 0 comments Download
M src/factory.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +5 lines, -3 lines 0 comments Download
M src/factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +28 lines, -7 lines 0 comments Download
M src/flag-definitions.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -0 lines 0 comments Download
A src/harmony-sharedarraybuffer.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +56 lines, -0 lines 0 comments Download
A + src/harmony-sharedtypedarray.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 8 chunks +30 lines, -178 lines 0 comments Download
M src/heap/objects-visiting.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 0 comments Download
M src/hydrogen.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -1 line 0 comments Download
M src/isolate.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +9 lines, -0 lines 0 comments Download
M src/macros.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -0 lines 0 comments Download
M src/objects.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +11 lines, -0 lines 0 comments Download
M src/objects.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -0 lines 0 comments Download
M src/objects-debug.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 0 comments Download
M src/objects-inl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +30 lines, -2 lines 0 comments Download
M src/objects-printer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -0 lines 0 comments Download
M src/runtime/runtime-typedarray.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +14 lines, -4 lines 0 comments Download
M src/typedarray.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -0 lines 0 comments Download
M src/types.cc View 1 1 chunk +2 lines, -0 lines 0 comments Download
M test/cctest/cctest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M test/cctest/test-api.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +130 lines, -0 lines 0 comments Download
A + test/mjsunit/shared-typed-arrays.js View 1 2 3 4 5 6 7 8 18 chunks +130 lines, -240 lines 0 comments Download
M tools/gyp/v8.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 42 (4 generated)
binji
PTAL, this is some initial work I've done to add SharedArrayBuffer. It's not clear to ...
5 years, 8 months ago (2015-04-09 00:10:54 UTC) #1
binji
+sehr, bradnelson
5 years, 8 months ago (2015-04-09 17:22:49 UTC) #2
Jarin
Adding dslomov as a reviewer because he is our typed array expert.
5 years, 8 months ago (2015-04-13 07:23:53 UTC) #4
jochen (gone - plz use gerrit)
fyi, i'm currently rewriting how we keep track of array buffers and views the tl;dr ...
5 years, 8 months ago (2015-04-16 14:48:27 UTC) #7
Jarin
The overall direction looks good. Thanks for working on this! I am not too happy ...
5 years, 8 months ago (2015-04-16 14:55:28 UTC) #8
binji
https://codereview.chromium.org/1069883002/diff/1/src/bootstrapper.cc File src/bootstrapper.cc (right): https://codereview.chromium.org/1069883002/diff/1/src/bootstrapper.cc#newcode194 src/bootstrapper.cc:194: bool is_shared); On 2015/04/16 14:55:28, jarin wrote: > Could ...
5 years, 8 months ago (2015-04-16 21:00:34 UTC) #9
Jarin
https://codereview.chromium.org/1069883002/diff/1/src/objects.h File src/objects.h (right): https://codereview.chromium.org/1069883002/diff/1/src/objects.h#newcode10265 src/objects.h:10265: static const int kIsSharedBit = 3; On 2015/04/16 21:00:34, ...
5 years, 8 months ago (2015-04-17 07:49:27 UTC) #10
binji
I'll work on some additional tests next. I think it's worth adding tests for constructing ...
5 years, 8 months ago (2015-04-17 09:06:44 UTC) #11
binji
On 2015/04/17 09:06:44, binji wrote: > I'll work on some additional tests next. > > ...
5 years, 8 months ago (2015-04-22 17:38:24 UTC) #12
bradn
Gentle ping. Ben plans to rebase as jochen refactors. More feedback would be helpful. Thanks ...
5 years, 7 months ago (2015-04-28 15:55:35 UTC) #14
jochen (gone - plz use gerrit)
some comments it's unfortunate that the shared thingies have a different map - that means ...
5 years, 7 months ago (2015-04-28 18:31:46 UTC) #15
Dmitry Lomov (no reviews)
On 2015/04/28 18:31:46, jochen wrote: > some comments > > it's unfortunate that the shared ...
5 years, 7 months ago (2015-04-28 19:39:05 UTC) #16
jochen (gone - plz use gerrit)
On 2015/04/28 at 19:39:05, dslomov wrote: > On 2015/04/28 18:31:46, jochen wrote: > > some ...
5 years, 7 months ago (2015-04-28 19:42:09 UTC) #17
Jarin
On 2015/04/28 19:42:09, jochen wrote: > On 2015/04/28 at 19:39:05, dslomov wrote: > > On ...
5 years, 7 months ago (2015-04-29 04:45:19 UTC) #18
Jarin
https://codereview.chromium.org/1069883002/diff/220001/src/bootstrapper.cc File src/bootstrapper.cc (right): https://codereview.chromium.org/1069883002/diff/220001/src/bootstrapper.cc#newcode1377 src/bootstrapper.cc:1377: is_shared ? JS_SHARED_TYPED_ARRAY_TYPE : JS_TYPED_ARRAY_TYPE; change to (is_shared == ...
5 years, 7 months ago (2015-04-29 04:46:01 UTC) #19
jochen (gone - plz use gerrit)
On 2015/04/29 at 04:45:19, jarin wrote: > On 2015/04/28 19:42:09, jochen wrote: > > On ...
5 years, 7 months ago (2015-04-29 07:29:32 UTC) #20
jochen (gone - plz use gerrit)
i'd also be interested in what happens if you postMessage an array buffer in blink. ...
5 years, 7 months ago (2015-04-29 07:30:18 UTC) #21
Jarin
On 2015/04/29 07:30:18, jochen wrote: > i'd also be interested in what happens if you ...
5 years, 7 months ago (2015-04-29 08:03:28 UTC) #22
jochen (gone - plz use gerrit)
On 2015/04/29 at 08:03:28, jarin wrote: > On 2015/04/29 07:30:18, jochen wrote: > > i'd ...
5 years, 7 months ago (2015-04-29 08:05:58 UTC) #23
binji
https://codereview.chromium.org/1069883002/diff/220001/include/v8.h File include/v8.h (right): https://codereview.chromium.org/1069883002/diff/220001/include/v8.h#newcode3684 include/v8.h:3684: class V8_EXPORT Allocator { // NOLINT On 2015/04/28 18:31:46, ...
5 years, 7 months ago (2015-04-29 18:27:22 UTC) #24
binji
On 2015/04/29 07:30:18, jochen wrote: > i'd also be interested in what happens if you ...
5 years, 7 months ago (2015-04-29 21:50:35 UTC) #25
jochen (gone - plz use gerrit)
On 2015/04/29 at 18:27:22, binji wrote: > https://codereview.chromium.org/1069883002/diff/220001/src/accessors.cc > File src/accessors.cc (right): > > https://codereview.chromium.org/1069883002/diff/220001/src/accessors.cc#newcode103 ...
5 years, 7 months ago (2015-04-30 07:07:59 UTC) #26
jochen (gone - plz use gerrit)
On 2015/04/29 at 21:50:35, binji wrote: > On 2015/04/29 07:30:18, jochen wrote: > > i'd ...
5 years, 7 months ago (2015-04-30 07:11:34 UTC) #27
binji
On 2015/04/30 07:07:59, jochen wrote: > On 2015/04/29 at 18:27:22, binji wrote: > > https://codereview.chromium.org/1069883002/diff/220001/src/accessors.cc ...
5 years, 7 months ago (2015-04-30 16:21:38 UTC) #28
binji
On 2015/04/30 07:11:34, jochen wrote: > On 2015/04/29 at 21:50:35, binji wrote: > > On ...
5 years, 7 months ago (2015-04-30 16:39:14 UTC) #29
binji
https://codereview.chromium.org/1069883002/diff/220001/src/bootstrapper.cc File src/bootstrapper.cc (right): https://codereview.chromium.org/1069883002/diff/220001/src/bootstrapper.cc#newcode1377 src/bootstrapper.cc:1377: is_shared ? JS_SHARED_TYPED_ARRAY_TYPE : JS_TYPED_ARRAY_TYPE; On 2015/04/29 04:46:00, jarin ...
5 years, 7 months ago (2015-04-30 16:39:43 UTC) #30
jochen (gone - plz use gerrit)
On 2015/04/30 at 16:21:38, binji wrote: > On 2015/04/30 07:07:59, jochen wrote: > > On ...
5 years, 7 months ago (2015-05-04 07:05:22 UTC) #31
jochen (gone - plz use gerrit)
I tried to think a bit about how we could make progress here. What is ...
5 years, 7 months ago (2015-05-05 15:27:29 UTC) #32
binji
On 2015/05/05 15:27:29, jochen wrote: > I tried to think a bit about how we ...
5 years, 7 months ago (2015-05-05 15:46:42 UTC) #33
binji
On 2015/05/04 07:05:22, jochen wrote: > On 2015/04/30 at 16:21:38, binji wrote: > > On ...
5 years, 7 months ago (2015-05-05 15:54:05 UTC) #34
jochen (gone - plz use gerrit)
If a SAB behaves like an AB of you don't use the correct atomics, we ...
5 years, 7 months ago (2015-05-05 16:06:19 UTC) #35
binji
On 2015/05/05 16:06:19, jochen wrote: > If a SAB behaves like an AB of you ...
5 years, 7 months ago (2015-05-05 16:14:22 UTC) #36
binji
On 2015/05/05 16:14:22, binji wrote: > On 2015/05/05 16:06:19, jochen wrote: > > If a ...
5 years, 7 months ago (2015-05-05 17:52:43 UTC) #37
Jarin
On 2015/05/05 17:52:43, binji wrote: > On 2015/05/05 16:14:22, binji wrote: > > On 2015/05/05 ...
5 years, 7 months ago (2015-05-06 06:27:06 UTC) #38
Jarin
On 2015/05/05 16:06:19, jochen wrote: > If a SAB behaves like an AB of you ...
5 years, 7 months ago (2015-05-06 06:31:22 UTC) #39
Jarin
> OK, I see. I don't really understand how the hydrogen stuff works; is it ...
5 years, 7 months ago (2015-05-06 06:35:43 UTC) #40
binji
> I think the complexity of this is getting a bit out of hands. Could ...
5 years, 7 months ago (2015-05-06 16:53:23 UTC) #41
binji
5 years, 7 months ago (2015-05-07 01:03:01 UTC) #42
On 2015/05/06 16:53:23, binji wrote:
> > I think the complexity of this is getting a bit out of hands. Could we
> possibly
> > have a separate design document which outlines what needs to be done?
> > 
> > The document should describe at least the following:
> > 
> > 1. Representation of SAB in v8.
> > 
> > 2. Compilation of non-atomic accesses to SAB. (Probably just like normal
> > accesses to AB, but if the SAB have different map as in the current version,
> one
> > has to be careful about map checks/polymorphism in hydrogen and ICs.)
> > 
> > 3. Compilation of atomic accesses to SAB. This should discuss all the
> compilers:
> > full code, hydrogen and turbofan. My guess is we would be fine with having
> > runtime functions for full code and hydrogen, but turbofan needs to have
> > optimized version. This should also discuss architecture specific details
> (such
> > as implementation on architectures without 64-bit atomic instructions).
> > 
> > 4. Compilation of futexes.
> > 
> > 5. Discussion of neutering and friends.
> > 
> > 6. API design, interface to the rest of chrome.
> > 
> > I am sure I am missing other important aspects.
> 
> Sorry for the confusion. You're right, it will be helpful to have an
> implementation document. I'll write one up today.

Still a lot more to add, but here is the doc:
https://docs.google.com/document/d/17bWw19CozbeDitdZxXBA-_7IdUzwzXB6XptLAIcsD...

Powered by Google App Engine
This is Rietveld 408576698