Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Unified Diff: runtime/vm/stack_frame.cc

Issue 816123002: MemorySanitizer support. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« runtime/platform/memory_sanitizer.h ('K') | « runtime/vm/scavenger.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stack_frame.cc
===================================================================
--- runtime/vm/stack_frame.cc (revision 42458)
+++ runtime/vm/stack_frame.cc (working copy)
@@ -4,6 +4,7 @@
#include "vm/stack_frame.h"
+#include "platform/memory_sanitizer.h"
#include "vm/assembler.h"
#include "vm/deopt_instructions.h"
#include "vm/isolate.h"
@@ -278,6 +279,14 @@
}
+// Tell MemorySanitizer that generated code initializes part of the stack.
+// TODO(koda): Limit to frames that are actually written by generated code.
+static void UnpoisonStack(Isolate* isolate) {
siva 2014/12/22 17:01:53 ASSERT(isolate->stack_limit() != ~static_cast<uwor
koda 2014/12/22 23:05:52 Changed to instead take an explicit 'fp' argument,
+ __msan_unpoison(reinterpret_cast<void*>(isolate->stack_limit()),
+ isolate->GetSpecifiedStackSize());
+}
+
+
StackFrameIterator::StackFrameIterator(bool validate, Isolate* isolate)
: validate_(validate),
entry_(isolate),
@@ -287,6 +296,7 @@
isolate_(isolate) {
ASSERT((isolate_ == Isolate::Current()) ||
OS::AllowStackFrameIteratorFromAnotherThread());
+ UnpoisonStack(isolate);
SetupLastExitFrameData(); // Setup data for last exit frame.
}
@@ -301,6 +311,7 @@
isolate_(isolate) {
ASSERT((isolate_ == Isolate::Current()) ||
OS::AllowStackFrameIteratorFromAnotherThread());
+ UnpoisonStack(isolate);
frames_.fp_ = last_fp;
frames_.sp_ = 0;
frames_.pc_ = 0;
@@ -317,6 +328,7 @@
isolate_(isolate) {
ASSERT((isolate_ == Isolate::Current()) ||
OS::AllowStackFrameIteratorFromAnotherThread());
+ UnpoisonStack(isolate);
frames_.fp_ = fp;
frames_.sp_ = sp;
frames_.pc_ = pc;
« runtime/platform/memory_sanitizer.h ('K') | « runtime/vm/scavenger.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698