Reviewers: danno,

Description:
[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.

Please review this at https://codereview.chromium.org/212833002/

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files (+7, -5 lines):
  M     src/msan.h
  M     src/spaces.cc


Index: src/msan.h
===================================================================
--- src/msan.h  (revision 20276)
+++ src/msan.h  (working copy)
@@ -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_
Index: src/spaces.cc
===================================================================
--- src/spaces.cc       (revision 20276)
+++ src/spaces.cc       (working copy)
@@ -711,7 +711,7 @@
                                                 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;
 }



--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to