implement compileTimeMemoryBarrier in arch.h

This has the same implementation as programOrderMemoryBarrier in
x86.h, but makes it available on all architectures.
This commit is contained in:
Joel Dice 2010-02-04 18:30:13 -07:00
parent 99bb7924b0
commit c2a9424f91
3 changed files with 16 additions and 6 deletions

View File

@ -17,6 +17,20 @@ extern "C" void NO_RETURN
vmJump(void* address, void* base, void* stack, void* thread,
uintptr_t returnLow, uintptr_t returnHigh);
namespace vm {
inline void
compileTimeMemoryBarrier()
{
#ifdef _MSC_VER
_ReadWriteBarrier();
#else
__asm__ __volatile__("": : :"memory");
#endif
}
} // namespace vm
#if (defined ARCH_x86_32) || (defined ARCH_x86_64)
# include "x86.h"
#elif defined ARCH_powerpc

View File

@ -23,7 +23,7 @@
#undef max
#undef min
#include "x86.h"
#include "arch.h"
#include "system.h"
#define ACQUIRE(s, x) MutexResource MAKE_NAME(mutexResource_) (s, x)

View File

@ -161,11 +161,7 @@ trap()
inline void
programOrderMemoryBarrier()
{
#ifdef _MSC_VER
_ReadWriteBarrier();
#else
__asm__ __volatile__("": : :"memory");
#endif
compileTimeMemoryBarrier();
}
inline void