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

Issue 10539044: define ATOMICOPS_COMPILER_BARRIER in platform.h (Closed)

Created:
8 years, 6 months ago by takano32
Modified:
8 years, 1 month ago
Reviewers:
Yang, Jakob Kummerow
CC:
v8-dev
Base URL:
git://github.com/v8/v8.git@master
Visibility:
Public.

Description

define ATOMICOPS_COMPILER_BARRIER in platform.h. such as defined in atomicops_internals_[arch]_gcc.h and use it in platform-[platform].cc BUG=none TEST=none

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -5 lines) Patch
M src/platform.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/platform-cygwin.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/platform-freebsd.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/platform-linux.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/platform-openbsd.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/platform-solaris.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
Jakob Kummerow
Thanks for the patch! It looks good to me (LGTM), but before I can land ...
8 years, 6 months ago (2012-06-08 14:58:09 UTC) #1
takano32
Thank you! i chosoe electricity sign. http://farm9.static.flickr.com/8160/7167514735_ae317bf289.jpg this commit experience is very exciting for me. ...
8 years, 6 months ago (2012-06-08 22:32:30 UTC) #2
Jakob Kummerow
8 years, 6 months ago (2012-06-11 09:23:58 UTC) #3
Actually, this doesn't compile for me:
../src/platform-linux.cc: In static member function 'static void
v8::internal::OS::ReleaseStore(volatile AtomicWord*, v8::internal::AtomicWord)':
../src/platform-linux.cc:281:30: error: 'ATOMICOPS_COMPILER_BARRIER' was not
declared in this scope

I think what happens is: platform.h includes atomicops.h which includes
atomicops_internals_x86_gcc.h which defines a macro of the same name (and
contents!) and then undefs it after it's done.
We normally try not to let macros live beyond file boundaries, i.e. define it
where it's needed, then undef it. Doing this in many places doesn't mix well
with not doing it elsewhere ;-)

So, I don't think we can land this CL in its current form or with minor fixes. A
better way might be to move the definitions that want to use
ATOMICOPS_COMPILER_BARRIER to atomicops_internals_x86_gcc.h where that macro is
already available, but I haven't looked into whether that's easily possible.

Powered by Google App Engine
This is Rietveld 408576698