Revision: 21901
Author:   [email protected]
Date:     Fri Jun 20 12:58:48 2014 UTC
Log:      Clean up unused stuff in atomicops_internals_{tsan,x86_gcc}.h

This ports crrev.com/278081 and crrev.com/271506 to V8.

[email protected], [email protected]

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

Modified:
 /branches/bleeding_edge/src/base/atomicops_internals_tsan.h
 /branches/bleeding_edge/src/base/atomicops_internals_x86_gcc.cc
 /branches/bleeding_edge/src/base/atomicops_internals_x86_gcc.h

=======================================
--- /branches/bleeding_edge/src/base/atomicops_internals_tsan.h Thu Jun 5 12:14:47 2014 UTC +++ /branches/bleeding_edge/src/base/atomicops_internals_tsan.h Fri Jun 20 12:58:48 2014 UTC
@@ -15,20 +15,6 @@
 #ifndef TSAN_INTERFACE_ATOMIC_H
 #define TSAN_INTERFACE_ATOMIC_H

-// This struct is not part of the public API of this module; clients may not -// use it. (However, it's exported via BASE_EXPORT because clients implicitly
-// do use it at link time by inlining these functions.)
-// Features of this x86.  Values may not be correct before main() is run,
-// but are set conservatively.
-struct AtomicOps_x86CPUFeatureStruct {
- bool has_amd_lock_mb_bug; // Processor has AMD memory-barrier bug; do lfence
-                             // after acquire compare-and-swap.
-  bool has_sse2;             // Processor has SSE2.
-};
-extern struct AtomicOps_x86CPUFeatureStruct
-    AtomicOps_Internalx86CPUFeatures;
-
-#define ATOMICOPS_COMPILER_BARRIER() __asm__ __volatile__("" : : : "memory")

 extern "C" {
 typedef char  __tsan_atomic8;
@@ -374,6 +360,4 @@
 }  // namespace base
 }  // namespace v8

-#undef ATOMICOPS_COMPILER_BARRIER
-
 #endif  // V8_BASE_ATOMICOPS_INTERNALS_TSAN_H_
=======================================
--- /branches/bleeding_edge/src/base/atomicops_internals_x86_gcc.cc Thu Jun 5 12:14:47 2014 UTC +++ /branches/bleeding_edge/src/base/atomicops_internals_x86_gcc.cc Fri Jun 20 12:58:48 2014 UTC
@@ -42,7 +42,6 @@
 // default values should hopefully be pretty safe.
 struct AtomicOps_x86CPUFeatureStruct AtomicOps_Internalx86CPUFeatures = {
   false,          // bug can't exist before process spawns multiple threads
-  false,          // no SSE2
 };

 } }  // namespace v8::base
@@ -88,9 +87,6 @@
   } else {
     AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug = false;
   }
-
-  // edx bit 26 is SSE2 which we use to tell use whether we can use mfence
-  AtomicOps_Internalx86CPUFeatures.has_sse2 = ((edx >> 26) & 1);
 }

 class AtomicOpsx86Initializer {
=======================================
--- /branches/bleeding_edge/src/base/atomicops_internals_x86_gcc.h Thu Jun 5 12:14:47 2014 UTC +++ /branches/bleeding_edge/src/base/atomicops_internals_x86_gcc.h Fri Jun 20 12:58:48 2014 UTC
@@ -17,7 +17,6 @@
 struct AtomicOps_x86CPUFeatureStruct {
bool has_amd_lock_mb_bug; // Processor has AMD memory-barrier bug; do lfence
                              // after acquire compare-and-swap.
-  bool has_sse2;             // Processor has SSE2.
 };
extern struct AtomicOps_x86CPUFeatureStruct AtomicOps_Internalx86CPUFeatures;

@@ -92,10 +91,7 @@
   *ptr = value;
 }

-#if defined(__x86_64__)
-
-// 64-bit implementations of memory barrier can be simpler, because it
-// "mfence" is guaranteed to exist.
+// We require SSE2, so mfence is guaranteed to exist.
 inline void MemoryBarrier() {
   __asm__ __volatile__("mfence" : : : "memory");
 }
@@ -104,28 +100,6 @@
   *ptr = value;
   MemoryBarrier();
 }
-
-#else
-
-inline void MemoryBarrier() {
-  if (AtomicOps_Internalx86CPUFeatures.has_sse2) {
-    __asm__ __volatile__("mfence" : : : "memory");
-  } else {  // mfence is faster but not present on PIII
-    Atomic32 x = 0;
-    NoBarrier_AtomicExchange(&x, 0);  // acts as a barrier on PIII
-  }
-}
-
-inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
-  if (AtomicOps_Internalx86CPUFeatures.has_sse2) {
-    *ptr = value;
-    __asm__ __volatile__("mfence" : : : "memory");
-  } else {
-    NoBarrier_AtomicExchange(ptr, value);
-                          // acts as a barrier on PIII
-  }
-}
-#endif

 inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
   ATOMICOPS_COMPILER_BARRIER();

--
--
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/d/optout.

Reply via email to