Chromium Code Reviews| Index: runtime/vm/stack_frame.cc |
| diff --git a/runtime/vm/stack_frame.cc b/runtime/vm/stack_frame.cc |
| index 4eb3da7e0d6b94b8b256e9f66d641093e2f3fd6a..77539d5901860204660b77d3b23e12ff2e315718 100644 |
| --- a/runtime/vm/stack_frame.cc |
| +++ b/runtime/vm/stack_frame.cc |
| @@ -68,6 +68,7 @@ void ExitFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) { |
| void EntryFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) { |
| +#if !defined(TARGET_ARCH_DBC) |
| ASSERT(thread() == Thread::Current()); |
| // Visit objects between SP and (FP - callee_save_area). |
| ASSERT(visitor != NULL); |
| @@ -75,10 +76,17 @@ void EntryFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) { |
| RawObject** last = reinterpret_cast<RawObject**>( |
| fp() + (kExitLinkSlotFromEntryFp - 1) * kWordSize); |
| visitor->VisitPointers(first, last); |
| +#else |
| + // On DBC stack is growing upwards which implies fp() <= sp(). |
| + RawObject** first = reinterpret_cast<RawObject**>(fp()); |
| + RawObject** last = reinterpret_cast<RawObject**>(sp()); |
| + visitor->VisitPointers(first, last); |
| +#endif |
| } |
| void StackFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) { |
| +#if !defined(TARGET_ARCH_DBC) |
| // 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 |
| // Scope handles. We use direct stack handles, the raw pointers in |
| @@ -157,6 +165,13 @@ void StackFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) { |
| RawObject** last = reinterpret_cast<RawObject**>( |
| fp() + (kFirstObjectSlotFromFp * kWordSize)); |
| visitor->VisitPointers(first, last); |
| +#else |
| + // On DBC stack grows upwards: fp() <= sp(). |
| + RawObject** first = reinterpret_cast<RawObject**>( |
| + fp() + (kFirstObjectSlotFromFp * kWordSize)); |
| + RawObject** last = reinterpret_cast<RawObject**>(sp()); |
| + visitor->VisitPointers(last, first); |
| +#endif |
|
zra
2016/04/14 18:27:50
add // !defined(TARGET_ARCH_DBC)
Vyacheslav Egorov (Google)
2016/04/18 15:56:43
Done.
|
| } |
| @@ -317,6 +332,7 @@ StackFrameIterator::StackFrameIterator(uword last_fp, bool validate, |
| } |
| +#if !defined(TARGET_ARCH_DBC) |
| StackFrameIterator::StackFrameIterator(uword fp, uword sp, uword pc, |
| bool validate, Thread* thread) |
| : validate_(validate), |
| @@ -331,6 +347,7 @@ StackFrameIterator::StackFrameIterator(uword fp, uword sp, uword pc, |
| frames_.sp_ = sp; |
| frames_.pc_ = pc; |
| } |
| +#endif |
| StackFrame* StackFrameIterator::NextFrame() { |
| @@ -351,6 +368,7 @@ StackFrame* StackFrameIterator::NextFrame() { |
| return NULL; |
| } |
| UnpoisonStack(frames_.fp_); |
| +#if !defined(TARGET_ARCH_DBC) |
| if (frames_.pc_ == 0) { |
| // Iteration starts from an exit frame given by its fp. |
| current_frame_ = NextExitFrame(); |
| @@ -362,6 +380,12 @@ StackFrame* StackFrameIterator::NextFrame() { |
| // Iteration starts from a Dart or stub frame given by its fp, sp, and pc. |
| current_frame_ = frames_.NextFrame(validate_); |
| } |
| +#else |
| + // Iteration starts from an exit frame given by its fp. This is the only |
| + // mode supported on DBC. |
| + ASSERT(frames_.pc_ == 0); |
| + current_frame_ = NextExitFrame(); |
| +#endif // !defined(TARGET_ARCH_DBC) |
| return current_frame_; |
| } |
| ASSERT((validate_ == kDontValidateFrames) || current_frame_->IsValid()); |