Commit 07ae09c1 authored by yurys@chromium.org's avatar yurys@chromium.org

Nuke OS::ReleaseStore, use Release_Store instead

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

BUG=None
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/17222004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15218 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent e64c79c2
......@@ -79,12 +79,6 @@ int OS::ActivationFrameAlignment() {
}
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));
......
......@@ -85,12 +85,6 @@ void OS::PostSetUp() {
}
void OS::ReleaseStore(volatile AtomicWord* ptr, AtomicWord value) {
__asm__ __volatile__("" : : : "memory");
*ptr = value;
}
uint64_t OS::CpuFeaturesImpliedByPlatform() {
return 0; // FreeBSD runs on anything.
}
......
......@@ -308,19 +308,6 @@ int OS::ActivationFrameAlignment() {
}
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) {
if (std::isnan(time)) return "";
time_t tv = static_cast<time_t>(floor(time/msPerSecond));
......
......@@ -295,12 +295,6 @@ int OS::ActivationFrameAlignment() {
}
void OS::ReleaseStore(volatile AtomicWord* ptr, AtomicWord value) {
OSMemoryBarrier();
*ptr = value;
}
const char* OS::LocalTimezone(double time) {
if (std::isnan(time)) return "";
time_t tv = static_cast<time_t>(floor(time/msPerSecond));
......
......@@ -117,13 +117,6 @@ int OS::ActivationFrameAlignment() {
}
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));
......
......@@ -111,12 +111,6 @@ int OS::ActivationFrameAlignment() {
}
void OS::ReleaseStore(volatile AtomicWord* ptr, AtomicWord value) {
__asm__ __volatile__("" : : : "memory");
*ptr = value;
}
const char* OS::LocalTimezone(double time) {
if (std::isnan(time)) return "";
time_t tv = static_cast<time_t>(floor(time/msPerSecond));
......
......@@ -1485,12 +1485,6 @@ int OS::ActivationFrameAlignment() {
}
void OS::ReleaseStore(volatile AtomicWord* ptr, AtomicWord value) {
MemoryBarrier();
*ptr = value;
}
VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { }
......
......@@ -100,7 +100,6 @@ int random();
#endif // WIN32
#include "atomicops.h"
#include "lazy-instance.h"
#include "platform-tls.h"
#include "utils.h"
......@@ -330,8 +329,6 @@ class OS {
// 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.
......
......@@ -30,6 +30,8 @@
#include "unbound-queue.h"
#include "atomicops.h"
namespace v8 {
namespace internal {
......@@ -70,7 +72,7 @@ void UnboundQueue<Record>::Dequeue(Record* rec) {
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 @@ template<typename Record>
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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment