[msan] Do not unpoison heap if running on simulator.

With the simulator, MSan detects all memory accesses from JIT code
without the need for annotations.

We'd like to keep the annotation in the native (w/o simulator) mode
until we can move all MSan+V8 users to simulator mode.

R=jkummerow@chromium.org

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20399 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 1d19dc9e
......@@ -30,6 +30,8 @@
#ifndef V8_MSAN_H_
#define V8_MSAN_H_
#include "globals.h"
#ifndef __has_feature
# define __has_feature(x) 0
#endif
......@@ -38,12 +40,12 @@
# define MEMORY_SANITIZER
#endif
#ifdef MEMORY_SANITIZER
# include <sanitizer/msan_interface.h>
#if defined(MEMORY_SANITIZER) && !defined(USE_SIMULATOR)
# include <sanitizer/msan_interface.h> // NOLINT
// Marks a memory range as fully initialized.
# define MSAN_MEMORY_IS_INITIALIZED(p, s) __msan_unpoison((p), (s))
# define MSAN_MEMORY_IS_INITIALIZED_IN_JIT(p, s) __msan_unpoison((p), (s))
#else
# define MSAN_MEMORY_IS_INITIALIZED(p, s)
# define MSAN_MEMORY_IS_INITIALIZED_IN_JIT(p, s)
#endif
#endif // V8_MSAN_H_
......@@ -711,7 +711,7 @@ MemoryChunk* MemoryAllocator::AllocateChunk(intptr_t reserve_area_size,
executable,
owner);
result->set_reserved_memory(&reservation);
MSAN_MEMORY_IS_INITIALIZED(base, chunk_size);
MSAN_MEMORY_IS_INITIALIZED_IN_JIT(base, chunk_size);
return result;
}
......
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