Revision: 15218
Author:   [email protected]
Date:     Wed Jun 19 23:16:24 2013
Log:      Nuke OS::ReleaseStore, use Release_Store instead

The operation is already implemented in atomicops.h No need to duplicate the code.

BUG=None
[email protected]

Review URL: https://codereview.chromium.org/17222004
http://code.google.com/p/v8/source/detail?r=15218

Modified:
 /branches/bleeding_edge/src/platform-cygwin.cc
 /branches/bleeding_edge/src/platform-freebsd.cc
 /branches/bleeding_edge/src/platform-linux.cc
 /branches/bleeding_edge/src/platform-macos.cc
 /branches/bleeding_edge/src/platform-openbsd.cc
 /branches/bleeding_edge/src/platform-solaris.cc
 /branches/bleeding_edge/src/platform-win32.cc
 /branches/bleeding_edge/src/platform.h
 /branches/bleeding_edge/src/unbound-queue-inl.h

=======================================
--- /branches/bleeding_edge/src/platform-cygwin.cc      Fri Apr 19 06:26:47 2013
+++ /branches/bleeding_edge/src/platform-cygwin.cc      Wed Jun 19 23:16:24 2013
@@ -79,12 +79,6 @@
 }


-void OS::ReleaseStore(volatile AtomicWord* ptr, AtomicWord value) {
-  __asm__ __volatile__("" : : : "memory");
-  // An x86 store acts as a release barrier.
-  *ptr = value;
-}
-
 const char* OS::LocalTimezone(double time) {
   if (std::isnan(time)) return "";
   time_t tv = static_cast<time_t>(floor(time/msPerSecond));
=======================================
--- /branches/bleeding_edge/src/platform-freebsd.cc     Fri Apr 19 06:26:47 2013
+++ /branches/bleeding_edge/src/platform-freebsd.cc     Wed Jun 19 23:16:24 2013
@@ -83,12 +83,6 @@
 void OS::PostSetUp() {
   POSIXPostSetUp();
 }
-
-
-void OS::ReleaseStore(volatile AtomicWord* ptr, AtomicWord value) {
-  __asm__ __volatile__("" : : : "memory");
-  *ptr = value;
-}


 uint64_t OS::CpuFeaturesImpliedByPlatform() {
=======================================
--- /branches/bleeding_edge/src/platform-linux.cc       Wed May 29 12:45:19 2013
+++ /branches/bleeding_edge/src/platform-linux.cc       Wed Jun 19 23:16:24 2013
@@ -306,19 +306,6 @@
   // that requires 16 byte alignment such as movdqa on x86.
   return 16;
 }
-
-
-void OS::ReleaseStore(volatile AtomicWord* ptr, AtomicWord value) {
-#if (defined(V8_TARGET_ARCH_ARM) && defined(__arm__)) || \
-    (defined(V8_TARGET_ARCH_MIPS) && defined(__mips__))
-  // Only use on ARM or MIPS hardware.
-  MemoryBarrier();
-#else
-  __asm__ __volatile__("" : : : "memory");
-  // An x86 store acts as a release barrier.
-#endif
-  *ptr = value;
-}


 const char* OS::LocalTimezone(double time) {
=======================================
--- /branches/bleeding_edge/src/platform-macos.cc       Fri Apr 19 06:26:47 2013
+++ /branches/bleeding_edge/src/platform-macos.cc       Wed Jun 19 23:16:24 2013
@@ -293,12 +293,6 @@
   // Function Call Guide".
   return 16;
 }
-
-
-void OS::ReleaseStore(volatile AtomicWord* ptr, AtomicWord value) {
-  OSMemoryBarrier();
-  *ptr = value;
-}


 const char* OS::LocalTimezone(double time) {
=======================================
--- /branches/bleeding_edge/src/platform-openbsd.cc     Wed May 29 12:45:19 2013
+++ /branches/bleeding_edge/src/platform-openbsd.cc     Wed Jun 19 23:16:24 2013
@@ -115,13 +115,6 @@
   // that requires 16 byte alignment such as movdqa on x86.
   return 16;
 }
-
-
-void OS::ReleaseStore(volatile AtomicWord* ptr, AtomicWord value) {
-  __asm__ __volatile__("" : : : "memory");
-  // An x86 store acts as a release barrier.
-  *ptr = value;
-}


 const char* OS::LocalTimezone(double time) {
=======================================
--- /branches/bleeding_edge/src/platform-solaris.cc     Fri Apr 19 06:26:47 2013
+++ /branches/bleeding_edge/src/platform-solaris.cc     Wed Jun 19 23:16:24 2013
@@ -109,12 +109,6 @@
   // GCC generates code that requires 16 byte alignment such as movdqa.
   return Max(STACK_ALIGN, 16);
 }
-
-
-void OS::ReleaseStore(volatile AtomicWord* ptr, AtomicWord value) {
-  __asm__ __volatile__("" : : : "memory");
-  *ptr = value;
-}


 const char* OS::LocalTimezone(double time) {
=======================================
--- /branches/bleeding_edge/src/platform-win32.cc       Fri Apr 19 09:38:19 2013
+++ /branches/bleeding_edge/src/platform-win32.cc       Wed Jun 19 23:16:24 2013
@@ -1483,12 +1483,6 @@
   return 8;  // Floating-point math runs faster with 8-byte alignment.
 #endif
 }
-
-
-void OS::ReleaseStore(volatile AtomicWord* ptr, AtomicWord value) {
-  MemoryBarrier();
-  *ptr = value;
-}


 VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { }
=======================================
--- /branches/bleeding_edge/src/platform.h      Fri Apr 19 06:26:47 2013
+++ /branches/bleeding_edge/src/platform.h      Wed Jun 19 23:16:24 2013
@@ -100,7 +100,6 @@

 #endif  // WIN32

-#include "atomicops.h"
 #include "lazy-instance.h"
 #include "platform-tls.h"
 #include "utils.h"
@@ -330,8 +329,6 @@
   // the platform doesn't care. Guaranteed to be a power of two.
   static int ActivationFrameAlignment();

-  static void ReleaseStore(volatile AtomicWord* ptr, AtomicWord value);
-
 #if defined(V8_TARGET_ARCH_IA32)
   // Limit below which the extra overhead of the MemCopy function is likely
   // to outweigh the benefits of faster copying.
=======================================
--- /branches/bleeding_edge/src/unbound-queue-inl.h     Tue Dec  7 03:01:02 2010
+++ /branches/bleeding_edge/src/unbound-queue-inl.h     Wed Jun 19 23:16:24 2013
@@ -30,6 +30,8 @@

 #include "unbound-queue.h"

+#include "atomicops.h"
+
 namespace v8 {
 namespace internal {

@@ -70,7 +72,7 @@
   ASSERT(divider_ != last_);
   Node* next = reinterpret_cast<Node*>(divider_)->next;
   *rec = next->value;
-  OS::ReleaseStore(&divider_, reinterpret_cast<AtomicWord>(next));
+  Release_Store(&divider_, reinterpret_cast<AtomicWord>(next));
 }


@@ -78,7 +80,7 @@
 void UnboundQueue<Record>::Enqueue(const Record& rec) {
   Node*& next = reinterpret_cast<Node*>(last_)->next;
   next = new Node(rec);
-  OS::ReleaseStore(&last_, reinterpret_cast<AtomicWord>(next));
+  Release_Store(&last_, reinterpret_cast<AtomicWord>(next));
   while (first_ != reinterpret_cast<Node*>(divider_)) DeleteFirst();
 }

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to