MSan does not understand inline asm. This change preinitializes cpuid

results, and disables the use of stos.

Random mmap() addresses conflict with sanitizer memory layout.

R=jkummerow@chromium.org

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

Patch from Evgeniy Stepanov <eugenis@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20400 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
jkummerow@chromium.org 2014-04-01 12:48:35 +00:00
parent 4fe93b2d22
commit 725ce114aa
3 changed files with 14 additions and 4 deletions

View File

@ -77,10 +77,10 @@ namespace {
void AtomicOps_Internalx86CPUFeaturesInit() {
using v8::internal::AtomicOps_Internalx86CPUFeatures;
uint32_t eax;
uint32_t ebx;
uint32_t ecx;
uint32_t edx;
uint32_t eax = 0;
uint32_t ebx = 0;
uint32_t ecx = 0;
uint32_t edx = 0;
// Get vendor string (issue CPUID with eax = 0)
cpuid(eax, ebx, ecx, edx, 0);

View File

@ -213,6 +213,11 @@ void* OS::GetRandomMmapAddr() {
// smarter about using mmap address hints.
// See http://code.google.com/p/nativeclient/issues/3341
return NULL;
#endif
#if defined(ADDRESS_SANITIZER) || defined(MEMORY_SANITIZER) || \
defined(THREAD_SANITIZER)
// Dynamic tools do not support custom mmap addresses.
return NULL;
#endif
Isolate* isolate = Isolate::UncheckedCurrent();
// Note that the current isolate isn't set up in a call path via

View File

@ -215,6 +215,11 @@ inline void MemsetPointer(T** dest, U* value, int counter) {
#undef STOS
#endif
#if defined(MEMORY_SANITIZER)
// MemorySanitizer does not understand inline assembly.
#undef STOS
#endif
#if defined(__GNUC__) && defined(STOS)
asm volatile(
"cld;"