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
#ifndef V8_MSAN_H_
#define V8_MSAN_H_
+#include "globals.h"
+
#ifndef __has_feature
# define __has_feature(x) 0
#endif
# 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_
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;
}