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

Issue 2623633003: [Atomics] Make Atomics.exchange a builtin using TF (Closed)

Created:
3 years, 11 months ago by aseemgarg
Modified:
3 years, 9 months ago
Reviewers:
Jarin, binji, adamk, jbramley
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[Atomics] Make Atomics.exchange a builtin using TF BUG=v8:4614 R=binji@chromium.org Review-Url: https://codereview.chromium.org/2623633003 Cr-Commit-Position: refs/heads/master@{#43623} Committed: https://chromium.googlesource.com/v8/v8/+/301c12376e5c675c5a3d5265d1bf2b3ab1e13679

Patch Set 1 #

Total comments: 7

Patch Set 2 : [Atomics] Make Atomics.exchange a builtin using TF #

Patch Set 3 : [Atomics] Make Atomics.exchange a builtin using TF #

Total comments: 6

Patch Set 4 : add ia32 #

Patch Set 5 : [Atomics] Make Atomics.exchange a builtin using TF #

Patch Set 6 : [Atomics] Make Atomics.exchange a builtin using TF #

Patch Set 7 : add arm #

Patch Set 8 : arm64 #

Patch Set 9 : [Atomics] Make Atomics.exchange a builtin using TF #

Patch Set 10 : arm64 #

Patch Set 11 : rebase on arm64 #

Patch Set 12 : rebase on arm64 #

Patch Set 13 : [Atomics] Make Atomics.exchange a builtin using TF #

Patch Set 14 : fix win #

Total comments: 8

Patch Set 15 : fix mips #

Patch Set 16 : rebase #

Patch Set 17 : use teq #

Patch Set 18 : rebase #

Patch Set 19 : [Atomics] Make Atomics.exchange a builtin using TF #

Patch Set 20 : rebase (CPP for mips; TFJ for others) #

Patch Set 21 : remove headers #

Total comments: 4

Patch Set 22 : mips and mips64 callback to runtime function #

Patch Set 23 : comment #

Patch Set 24 : rebase #

Patch Set 25 : [Atomics] Make Atomics.exchange a builtin using TF #

Patch Set 26 : remove 0 extend for arm #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+451 lines, -93 lines) Patch
M src/bootstrapper.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +3 lines, -0 lines 0 comments Download
M src/builtins/builtins.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 chunks +2 lines, -0 lines 0 comments Download
M src/builtins/builtins-sharedarraybuffer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 4 chunks +89 lines, -9 lines 2 comments Download
M src/compiler/arm/code-generator-arm.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 chunks +30 lines, -0 lines 0 comments Download
M src/compiler/arm/instruction-selector-arm.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +36 lines, -0 lines 0 comments Download
M src/compiler/arm64/code-generator-arm64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 3 chunks +30 lines, -0 lines 1 comment Download
M src/compiler/arm64/instruction-selector-arm64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +36 lines, -0 lines 0 comments Download
M src/compiler/code-assembler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +3 lines, -0 lines 0 comments Download
M src/compiler/code-assembler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +5 lines, -0 lines 0 comments Download
M src/compiler/ia32/code-generator-ia32.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +24 lines, -18 lines 0 comments Download
M src/compiler/ia32/instruction-codes-ia32.h View 1 2 3 1 chunk +1 line, -4 lines 0 comments Download
M src/compiler/ia32/instruction-scheduler-ia32.cc View 1 2 3 1 chunk +0 lines, -5 lines 0 comments Download
M src/compiler/ia32/instruction-selector-ia32.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +44 lines, -4 lines 0 comments Download
M src/compiler/instruction-codes.h View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download
M src/compiler/instruction-scheduler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +7 lines, -0 lines 0 comments Download
M src/compiler/instruction-selector.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +5 lines, -0 lines 0 comments Download
M src/compiler/machine-graph-verifier.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +5 lines, -14 lines 0 comments Download
M src/compiler/machine-operator.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 chunks +4 lines, -0 lines 0 comments Download
M src/compiler/machine-operator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 3 chunks +28 lines, -0 lines 0 comments Download
M src/compiler/mips/code-generator-mips.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +7 lines, -0 lines 0 comments Download
M src/compiler/mips/instruction-selector-mips.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +2 lines, -0 lines 0 comments Download
M src/compiler/mips64/code-generator-mips64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +7 lines, -0 lines 0 comments Download
M src/compiler/mips64/instruction-selector-mips64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +2 lines, -0 lines 0 comments Download
M src/compiler/opcodes.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +1 line, -0 lines 0 comments Download
M src/compiler/raw-machine-assembler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +4 lines, -0 lines 0 comments Download
M src/compiler/verifier.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +1 line, -0 lines 0 comments Download
M src/compiler/x64/code-generator-x64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +24 lines, -18 lines 0 comments Download
M src/compiler/x64/instruction-codes-x64.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +0 lines, -3 lines 0 comments Download
M src/compiler/x64/instruction-scheduler-x64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +0 lines, -5 lines 0 comments Download
M src/compiler/x64/instruction-selector-x64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +44 lines, -4 lines 0 comments Download
M src/js/harmony-atomics.js View 1 2 3 4 5 6 7 13 14 15 16 17 18 19 2 chunks +0 lines, -8 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 17 18 19 1 chunk +2 lines, -1 line 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 73 (51 generated)
aseemgarg
Ben, please take a look if it generally looks good. I'll add other architectures in ...
3 years, 11 months ago (2017-01-09 23:36:54 UTC) #1
binji
looks good so far; some quick notes. https://codereview.chromium.org/2623633003/diff/1/src/builtins/builtins-sharedarraybuffer.cc File src/builtins/builtins-sharedarraybuffer.cc (right): https://codereview.chromium.org/2623633003/diff/1/src/builtins/builtins-sharedarraybuffer.cc#newcode302 src/builtins/builtins-sharedarraybuffer.cc:302: a.Bind(&u8); nit: ...
3 years, 11 months ago (2017-01-13 00:08:50 UTC) #2
aseemgarg
https://codereview.chromium.org/2623633003/diff/1/src/builtins/builtins-sharedarraybuffer.cc File src/builtins/builtins-sharedarraybuffer.cc (right): https://codereview.chromium.org/2623633003/diff/1/src/builtins/builtins-sharedarraybuffer.cc#newcode302 src/builtins/builtins-sharedarraybuffer.cc:302: a.Bind(&u8); On 2017/01/13 00:08:50, binji wrote: > nit: I'd ...
3 years, 11 months ago (2017-01-14 01:48:19 UTC) #3
binji
https://codereview.chromium.org/2623633003/diff/1/src/compiler/x64/instruction-selector-x64.cc File src/compiler/x64/instruction-selector-x64.cc (right): https://codereview.chromium.org/2623633003/diff/1/src/compiler/x64/instruction-selector-x64.cc#newcode2401 src/compiler/x64/instruction-selector-x64.cc:2401: if (type == MachineType::Uint8() || type == MachineType::Int8()) { ...
3 years, 11 months ago (2017-01-17 21:45:50 UTC) #4
aseemgarg
https://codereview.chromium.org/2623633003/diff/40001/src/compiler/x64/code-generator-x64.cc File src/compiler/x64/code-generator-x64.cc (right): https://codereview.chromium.org/2623633003/diff/40001/src/compiler/x64/code-generator-x64.cc#newcode2220 src/compiler/x64/code-generator-x64.cc:2220: __ xchgb(r, operand, true); On 2017/01/17 21:45:50, binji wrote: ...
3 years, 11 months ago (2017-01-21 08:40:37 UTC) #5
aseemgarg
This can go in after https://codereview.chromium.org/2711473002/
3 years, 10 months ago (2017-02-21 13:57:27 UTC) #6
binji
looks pretty good. As we discussed offline, see if you can continue to use the ...
3 years, 10 months ago (2017-02-22 02:08:38 UTC) #19
aseemgarg
https://codereview.chromium.org/2623633003/diff/260001/src/compiler/arm64/code-generator-arm64.cc File src/compiler/arm64/code-generator-arm64.cc (right): https://codereview.chromium.org/2623633003/diff/260001/src/compiler/arm64/code-generator-arm64.cc#newcode535 src/compiler/arm64/code-generator-arm64.cc:535: __ Dmb(InnerShareable, BarrierAll); \ On 2017/02/22 02:08:38, binji wrote: ...
3 years, 10 months ago (2017-02-22 03:29:02 UTC) #20
commit-bot: I haz the power
This CL has an open dependency (Issue 2711473002 Patch 60001). Please resolve the dependency and ...
3 years, 10 months ago (2017-02-24 13:42:12 UTC) #27
binji
lgtm jarin: we don't have MIPS/MIPS64 implementation in TFJ currently (missing simulator, assembler ops, etc.). ...
3 years, 9 months ago (2017-03-01 03:30:16 UTC) #43
Jarin
https://codereview.chromium.org/2623633003/diff/400001/src/builtins/builtins.h File src/builtins/builtins.h (right): https://codereview.chromium.org/2623633003/diff/400001/src/builtins/builtins.h#newcode54 src/builtins/builtins.h:54: CPP(AtomicsExchange) Rather than special casing here, could you keep ...
3 years, 9 months ago (2017-03-01 07:45:37 UTC) #46
aseemgarg
https://codereview.chromium.org/2623633003/diff/400001/src/builtins/builtins.h File src/builtins/builtins.h (right): https://codereview.chromium.org/2623633003/diff/400001/src/builtins/builtins.h#newcode54 src/builtins/builtins.h:54: CPP(AtomicsExchange) On 2017/03/01 07:45:37, Jarin wrote: > Rather than ...
3 years, 9 months ago (2017-03-02 03:26:56 UTC) #47
Jarin
lgtm https://codereview.chromium.org/2623633003/diff/500001/src/builtins/builtins-sharedarraybuffer.cc File src/builtins/builtins-sharedarraybuffer.cc (right): https://codereview.chromium.org/2623633003/diff/500001/src/builtins/builtins-sharedarraybuffer.cc#newcode297 src/builtins/builtins-sharedarraybuffer.cc:297: index_integer, value_integer)); Can't you tail-call to the runtime? ...
3 years, 9 months ago (2017-03-06 10:59:05 UTC) #56
aseemgarg
https://codereview.chromium.org/2623633003/diff/500001/src/builtins/builtins-sharedarraybuffer.cc File src/builtins/builtins-sharedarraybuffer.cc (right): https://codereview.chromium.org/2623633003/diff/500001/src/builtins/builtins-sharedarraybuffer.cc#newcode297 src/builtins/builtins-sharedarraybuffer.cc:297: index_integer, value_integer)); On 2017/03/06 10:59:05, Jarin wrote: > Can't ...
3 years, 9 months ago (2017-03-06 23:20:07 UTC) #57
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/2623633003/500001
3 years, 9 months ago (2017-03-06 23:29:52 UTC) #60
commit-bot: I haz the power
Try jobs failed on following builders: v8_presubmit on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/36062)
3 years, 9 months ago (2017-03-06 23:33:31 UTC) #62
aseemgarg
3 years, 9 months ago (2017-03-06 23:45:07 UTC) #64
aseemgarg
+adamk for src/js/harmony-atomics.js
3 years, 9 months ago (2017-03-06 23:47:20 UTC) #65
adamk
lgtm
3 years, 9 months ago (2017-03-06 23:58:10 UTC) #66
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/2623633003/500001
3 years, 9 months ago (2017-03-07 00:01:21 UTC) #68
commit-bot: I haz the power
Committed patchset #26 (id:500001) as https://chromium.googlesource.com/v8/v8/+/301c12376e5c675c5a3d5265d1bf2b3ab1e13679
3 years, 9 months ago (2017-03-07 00:07:56 UTC) #71
jbramley
3 years, 9 months ago (2017-03-08 11:11:07 UTC) #73
Message was sent while issue was closed.
Sorry, I realise that I missed the review window, but I have one comment about
the correct use of atomics on AArch64.

https://codereview.chromium.org/2623633003/diff/500001/src/compiler/arm64/cod...
File src/compiler/arm64/code-generator-arm64.cc (right):

https://codereview.chromium.org/2623633003/diff/500001/src/compiler/arm64/cod...
src/compiler/arm64/code-generator-arm64.cc:539: i.TempRegister(0));             
                   \
Acquire/release instructions shouldn't be used to control access to resources
that are also controlled via traditional barriers (like in
ASSEMBLE_ATOMIC_STORE_INTEGER above). For a given shared resource, we need to
pick one approach and use it consistently.

Ideally, these should all use acquire/release semantics since we know that
they're always available for AArch64, and theoretically they are faster.
However, the existing ones use traditional load/store+barrier sequences and
rewriting them will be a lot of work. Perhaps for now,
ASSEMBLE_ATOMIC_EXCHANGE_INTEGER should also use a dmb-based implementation.

Powered by Google App Engine
This is Rietveld 408576698