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

Issue 1162503002: Implement Atomics API (Closed)

Created:
5 years, 7 months ago by binji
Modified:
5 years, 6 months ago
Reviewers:
Benedikt Meurer, Jarin
CC:
v8-dev
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Implement Atomics API This is behind the flag "--harmony-atomics", and it only works on SharedArrayBuffers. This implementation only includes the runtime functions. The TurboFan implementation will be next. The draft spec for Atomics can be found here: https://docs.google.com/document/d/1NDGA_gZJ7M7w1Bh8S0AoDyEqwDdRh4uSoTPSNn77PFk BUG= LOG=n Committed: https://crrev.com/e59e40a3542f6611dcf4696321feea4d135169ff Cr-Commit-Position: refs/heads/master@{#28796}

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : add global lock for 64-bit atomics on 32-bit systems #

Patch Set 4 : fix warnings #

Total comments: 13

Patch Set 5 : fixes + asm tests #

Patch Set 6 : merge master #

Total comments: 2

Patch Set 7 : add more symbols to anonymous namespace #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2344 lines, -5 lines) Patch
M BUILD.gn View 1 2 3 4 5 2 chunks +2 lines, -0 lines 0 comments Download
M src/bootstrapper.cc View 1 2 3 4 5 9 chunks +35 lines, -4 lines 0 comments Download
M src/flag-definitions.h View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
A src/harmony-atomics.js View 1 1 chunk +143 lines, -0 lines 0 comments Download
M src/messages.h View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M src/objects.h View 1 2 3 4 5 1 chunk +5 lines, -0 lines 0 comments Download
M src/runtime/runtime.h View 1 2 3 4 5 5 chunks +41 lines, -0 lines 0 comments Download
A src/runtime/runtime-atomics.cc View 1 2 3 4 5 6 1 chunk +715 lines, -0 lines 0 comments Download
M src/runtime/runtime-typedarray.cc View 1 2 3 4 5 1 chunk +23 lines, -0 lines 0 comments Download
M src/runtime/runtime-utils.h View 1 2 3 4 5 1 chunk +11 lines, -0 lines 0 comments Download
A test/mjsunit/asm/atomics-add.js View 1 2 3 4 1 chunk +93 lines, -0 lines 0 comments Download
A test/mjsunit/asm/atomics-and.js View 1 2 3 4 1 chunk +94 lines, -0 lines 0 comments Download
A test/mjsunit/asm/atomics-compareexchange.js View 1 2 3 4 1 chunk +121 lines, -0 lines 0 comments Download
A test/mjsunit/asm/atomics-exchange.js View 1 2 3 4 1 chunk +92 lines, -0 lines 0 comments Download
A test/mjsunit/asm/atomics-load.js View 2 3 4 1 chunk +102 lines, -0 lines 0 comments Download
A test/mjsunit/asm/atomics-or.js View 1 2 3 4 1 chunk +93 lines, -0 lines 0 comments Download
A test/mjsunit/asm/atomics-store.js View 1 2 3 4 1 chunk +109 lines, -0 lines 0 comments Download
A test/mjsunit/asm/atomics-sub.js View 1 2 3 4 1 chunk +94 lines, -0 lines 0 comments Download
A test/mjsunit/asm/atomics-xor.js View 1 2 3 4 1 chunk +93 lines, -0 lines 0 comments Download
A test/mjsunit/harmony/atomics.js View 1 1 chunk +472 lines, -0 lines 0 comments Download
M tools/gyp/v8.gyp View 1 2 3 4 5 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (4 generated)
binji
5 years, 6 months ago (2015-06-01 05:57:03 UTC) #2
Jarin
Adding bmeurer@ to have a look at the builtin magic.
5 years, 6 months ago (2015-06-01 06:45:17 UTC) #4
Benedikt Meurer
Can you please add "use asm" tests in mjsunit/compiler/asm as well?
5 years, 6 months ago (2015-06-01 06:45:23 UTC) #5
Benedikt Meurer
Builtins part looks good.
5 years, 6 months ago (2015-06-01 06:46:58 UTC) #6
Jarin
lgtm with some nits and non-blocking questions. https://codereview.chromium.org/1162503002/diff/60001/src/objects.h File src/objects.h (right): https://codereview.chromium.org/1162503002/diff/60001/src/objects.h#newcode6913 src/objects.h:6913: ATOMIC_FUNCTIONS_WITH_ID_LIST(DECLARE_FUNCTION_ID) Funny ...
5 years, 6 months ago (2015-06-01 17:50:10 UTC) #7
arv (Not doing code reviews)
Can you link to spec drafts in the CL description and in the code?
5 years, 6 months ago (2015-06-01 17:56:17 UTC) #8
binji
https://codereview.chromium.org/1162503002/diff/60001/src/objects.h File src/objects.h (right): https://codereview.chromium.org/1162503002/diff/60001/src/objects.h#newcode6913 src/objects.h:6913: ATOMIC_FUNCTIONS_WITH_ID_LIST(DECLARE_FUNCTION_ID) On 2015/06/01 at 17:50:10, jarin wrote: > Funny ...
5 years, 6 months ago (2015-06-02 21:32:56 UTC) #9
Benedikt Meurer
LGTM, although I'm still scared by several atomic operations on float32 and float64...
5 years, 6 months ago (2015-06-03 03:08:14 UTC) #10
Jarin
still lgtm with some non-blocking nits. https://codereview.chromium.org/1162503002/diff/60001/src/objects.h File src/objects.h (right): https://codereview.chromium.org/1162503002/diff/60001/src/objects.h#newcode6913 src/objects.h:6913: ATOMIC_FUNCTIONS_WITH_ID_LIST(DECLARE_FUNCTION_ID) On 2015/06/02 ...
5 years, 6 months ago (2015-06-03 13:30:15 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1162503002/120001
5 years, 6 months ago (2015-06-03 16:40:01 UTC) #14
commit-bot: I haz the power
Committed patchset #7 (id:120001)
5 years, 6 months ago (2015-06-03 17:58:35 UTC) #15
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/e59e40a3542f6611dcf4696321feea4d135169ff Cr-Commit-Position: refs/heads/master@{#28796}
5 years, 6 months ago (2015-06-03 17:58:54 UTC) #16
binji
5 years, 6 months ago (2015-06-03 20:16:32 UTC) #17
Message was sent while issue was closed.
https://codereview.chromium.org/1162503002/diff/100001/src/runtime/runtime-at...
File src/runtime/runtime-atomics.cc (right):

https://codereview.chromium.org/1162503002/diff/100001/src/runtime/runtime-at...
src/runtime/runtime-atomics.cc:176: }  // anonymous namespace
On 2015/06/03 at 13:30:15, jarin wrote:
> Could not even the stuff below go into the anonymous namespace? (Basically
everything except the runtime functions.)

Done.

Powered by Google App Engine
This is Rietveld 408576698