Index: runtime/vm/stack_frame.cc |
diff --git a/runtime/vm/stack_frame.cc b/runtime/vm/stack_frame.cc |
index d89797df39c17e626289be29b670818901480573..5d5b210ad5e55959413b5d15f39883d194f8a6db 100644 |
--- a/runtime/vm/stack_frame.cc |
+++ b/runtime/vm/stack_frame.cc |
@@ -68,7 +68,6 @@ void ExitFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) { |
void EntryFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) { |
- ASSERT(thread() == Thread::Current()); |
// Visit objects between SP and (FP - callee_save_area). |
ASSERT(visitor != NULL); |
#if !defined(TARGET_ARCH_DBC) |
@@ -86,7 +85,6 @@ void EntryFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) { |
void StackFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) { |
- ASSERT(thread() == Thread::Current()); |
ASSERT(visitor != NULL); |
// NOTE: This code runs while GC is in progress and runs within |
// a NoHandleScope block. Hence it is not ok to use regular Zone or |
@@ -346,30 +344,31 @@ static void UnpoisonStack(uword fp) { |
} |
-StackFrameIterator::StackFrameIterator(bool validate, Thread* thread) |
+StackFrameIterator::StackFrameIterator(bool validate, |
+ Thread* thread, |
+ bool allow_iterating_other_thread) |
: validate_(validate), |
entry_(thread), |
exit_(thread), |
frames_(thread), |
current_frame_(NULL), |
thread_(thread) { |
- ASSERT((thread_ == Thread::Current()) || |
- OS::AllowStackFrameIteratorFromAnotherThread()); |
+ ASSERT((allow_iterating_other_thread || thread_ == Thread::Current())); |
SetupLastExitFrameData(); // Setup data for last exit frame. |
} |
StackFrameIterator::StackFrameIterator(uword last_fp, |
bool validate, |
- Thread* thread) |
+ Thread* thread, |
+ bool allow_iterating_other_thread) |
: validate_(validate), |
entry_(thread), |
exit_(thread), |
frames_(thread), |
current_frame_(NULL), |
thread_(thread) { |
- ASSERT((thread_ == Thread::Current()) || |
- OS::AllowStackFrameIteratorFromAnotherThread()); |
+ ASSERT((allow_iterating_other_thread || thread_ == Thread::Current())); |
frames_.fp_ = last_fp; |
frames_.sp_ = 0; |
frames_.pc_ = 0; |
@@ -381,15 +380,15 @@ StackFrameIterator::StackFrameIterator(uword fp, |
uword sp, |
uword pc, |
bool validate, |
- Thread* thread) |
+ Thread* thread, |
+ bool allow_iterating_other_thread) |
: validate_(validate), |
entry_(thread), |
exit_(thread), |
frames_(thread), |
current_frame_(NULL), |
thread_(thread) { |
- ASSERT((thread_ == Thread::Current()) || |
- OS::AllowStackFrameIteratorFromAnotherThread()); |
+ ASSERT((allow_iterating_other_thread || thread_ == Thread::Current())); |
frames_.fp_ = fp; |
frames_.sp_ = sp; |
frames_.pc_ = pc; |
@@ -577,7 +576,8 @@ intptr_t InlinedFunctionsIterator::GetDeoptFpOffset() const { |
#if defined(DEBUG) |
void ValidateFrames() { |
- StackFrameIterator frames(StackFrameIterator::kValidateFrames); |
+ StackFrameIterator frames(StackFrameIterator::kValidateFrames, |
+ Thread::Current(), false); |
StackFrame* frame = frames.NextFrame(); |
while (frame != NULL) { |
frame = frames.NextFrame(); |