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

Issue 1287853005: Compatible atomics: volatile for LoadRelaxed, replace FetchAndAdd with FetchAndDecrement. (Closed)

Created:
5 years, 4 months ago by koda
Modified:
5 years, 4 months ago
Reviewers:
Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Compatible atomics: volatile for LoadRelaxed, replace FetchAndAdd with FetchAndDecrement. Using volatile on a word size location will generate a single move instruction without order guarantees and is supported on all compilers. Replace FetchAndAdd with FetchAndDecrement, since the latter is sufficient and eaiser to implement portably (in particular on some Windows setups). BUG=https://github.com/dart-lang/sdk/issues/24049 R=iposva@google.com Committed: https://github.com/dart-lang/sdk/commit/e7fb1c8516c99279551471986f044655285e7bbb

Patch Set 1 #

Patch Set 2 : Comment. #

Total comments: 4

Patch Set 3 : Additional comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+29 lines, -25 lines) Patch
M runtime/tests/vm/vm.status View 1 chunk +0 lines, -2 lines 0 comments Download
M runtime/vm/atomic.h View 1 2 1 chunk +13 lines, -4 lines 0 comments Download
M runtime/vm/atomic_android.h View 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/vm/atomic_linux.h View 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/vm/atomic_macos.h View 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/vm/atomic_test.cc View 1 chunk +5 lines, -8 lines 0 comments Download
M runtime/vm/atomic_win.h View 1 chunk +5 lines, -5 lines 0 comments Download

Messages

Total messages: 5 (1 generated)
koda
5 years, 4 months ago (2015-08-12 20:16:27 UTC) #2
Ivan Posva
LGTM with comments added. -Ivan https://codereview.chromium.org/1287853005/diff/20001/runtime/vm/atomic.h File runtime/vm/atomic.h (right): https://codereview.chromium.org/1287853005/diff/20001/runtime/vm/atomic.h#newcode24 runtime/vm/atomic.h:24: static uintptr_t FetchAndDecrement(uintptr_t* p); ...
5 years, 4 months ago (2015-08-13 01:43:22 UTC) #3
koda
Committed patchset #3 (id:40001) manually as e7fb1c8516c99279551471986f044655285e7bbb (presubmit successful).
5 years, 4 months ago (2015-08-13 16:21:42 UTC) #4
koda
5 years, 4 months ago (2015-08-13 16:22:38 UTC) #5
Message was sent while issue was closed.
https://codereview.chromium.org/1287853005/diff/20001/runtime/vm/atomic.h
File runtime/vm/atomic.h (right):

https://codereview.chromium.org/1287853005/diff/20001/runtime/vm/atomic.h#new...
runtime/vm/atomic.h:24: static uintptr_t FetchAndDecrement(uintptr_t* p);
On 2015/08/13 01:43:21, Ivan Posva wrote:
> This also needs the comment from above. Especially the NOTE about being
accessed
> by generated code.

Done.

https://codereview.chromium.org/1287853005/diff/20001/runtime/vm/atomic.h#new...
runtime/vm/atomic.h:26: static uword CompareAndSwapWord(uword* ptr, uword
old_value, uword new_value);
On 2015/08/13 01:43:21, Ivan Posva wrote:
> Please add a comment here as well plus the NOTE that CompareAndSwapWord is
safe
> for use with generated code.

Done.

Powered by Google App Engine
This is Rietveld 408576698