diff options
author | Raphael Kubo da Costa <rakuco@FreeBSD.org> | 2013-06-11 14:56:51 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-06-11 16:55:25 +0200 |
commit | 184fc178f4c753727445694c4830c250f53da588 (patch) | |
tree | 4b54aa07a73618ed5101a25a15836dc00f6c3399 | |
parent | cb98d9513e9612ce9af846e625caedfe6af9cc9c (diff) | |
download | qtscript-184fc178f4c753727445694c4830c250f53da588.tar.gz |
Bring in WebKit revisions 139553 and 139921.
They are primarily useful for getting rid of some libstdc++-specific
includes which break the build with libc++, and also for simplifying the
code and removing a Darwin-specific code path.
r139553 by ossy@webkit.org:
Use sync_add_and_fetch instead of gnu_cxx::exchange_and_add
https://bugs.webkit.org/show_bug.cgi?id=106729
After r139514 we need atomicIncrement(int64_t volatile*) for all
platform. Now the GCC implementation of atomicIncrement() is based on
gnu_cxx::exchange_and_add, which doesn't support int64_t type, but
sync_add_and_fetch does.
Reviewed by Benjamin Poulain.
r139921 by benjamin@webkit.org:
Use GCC's implementation of atomicIncrement/Decrement on Mac
https://bugs.webkit.org/show_bug.cgi?id=106976
Reviewed by Filip Pizlo.
wtf/Atomics.h: GCC and LLVM have builtin for atomic ADD and SUB:
sync_add_and_fetch, sync_sub_and_fetch.
Using them let the compiler just generate the atomic operations inline
instead of generating a function call to LibC. It also simplify the
code a bit.
Change-Id: Ic85cc1cc436477c63d2ebaf4f9ee2dfe7c05839f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h index d1944a5..1f6d25e 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h @@ -71,18 +71,10 @@ #if OS(WINDOWS) && !OS(WINCE) #include <windows.h> -#elif OS(DARWIN) -#include <libkern/OSAtomic.h> #elif OS(ANDROID) && !PLATFORM(QT) #include <cutils/atomic.h> #elif OS(QNX) #include <atomic.h> -#elif COMPILER(GCC) && !OS(SYMBIAN) -#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) -#include <ext/atomicity.h> -#else -#include <bits/atomicity.h> -#endif #endif #if USE(PTHREADS) @@ -230,12 +222,6 @@ inline int atomicIncrement(int volatile* addend) { return InterlockedIncrement(r inline int atomicDecrement(int volatile* addend) { return InterlockedDecrement(reinterpret_cast<long volatile*>(addend)); } #endif -#elif OS(DARWIN) -#define WTF_USE_LOCKFREE_THREADSAFESHARED 1 - -inline int atomicIncrement(int volatile* addend) { return OSAtomicIncrement32Barrier(const_cast<int*>(addend)); } -inline int atomicDecrement(int volatile* addend) { return OSAtomicDecrement32Barrier(const_cast<int*>(addend)); } - #elif OS(ANDROID) && !PLATFORM(QT) inline int atomicIncrement(int volatile* addend) { return android_atomic_inc(addend); } @@ -250,8 +236,8 @@ inline int atomicDecrement(int volatile* addend) { return (int) atomic_sub_value #elif COMPILER(GCC) && !CPU(SPARC64) && !OS(SYMBIAN) // sizeof(_Atomic_word) != sizeof(int) on sparc64 gcc #define WTF_USE_LOCKFREE_THREADSAFESHARED 1 -inline int atomicIncrement(int volatile* addend) { return __gnu_cxx::__exchange_and_add(addend, 1) + 1; } -inline int atomicDecrement(int volatile* addend) { return __gnu_cxx::__exchange_and_add(addend, -1) - 1; } +inline int atomicIncrement(int volatile* addend) { return __sync_add_and_fetch(addend, 1); } +inline int atomicDecrement(int volatile* addend) { return __sync_sub_and_fetch(addend, 1); } #endif |