| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | |
| 2 // for details. All rights reserved. Use of this source code is governed by a | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 #include "vm/globals.h" | |
| 6 #if defined(TARGET_ARCH_MIPS) | |
| 7 | |
| 8 #include "vm/stack_frame.h" | |
| 9 | |
| 10 namespace dart { | |
| 11 | |
| 12 // The constant kExitLinkOffsetInEntryFrame must be kept in sync with the | |
| 13 // code in the InvokeDartCode stub. | |
| 14 static const int kSavedContextOffsetInEntryFrame = -11 * kWordSize; | |
| 15 static const int kExitLinkOffsetInEntryFrame = -10 * kWordSize; | |
| 16 static const int kPcAddressOffsetFromSp = -2 * kWordSize; | |
| 17 static const int kEntrypointMarkerOffsetFromFp = 2 * kWordSize; | |
| 18 static const int kSpOffsetFromPreviousFp = 3 * kWordSize; | |
| 19 | |
| 20 | |
| 21 intptr_t StackFrame::PcAddressOffsetFromSp() { | |
| 22 return kPcAddressOffsetFromSp; | |
| 23 } | |
| 24 | |
| 25 | |
| 26 intptr_t StackFrame::EntrypointMarkerOffsetFromFp() { | |
| 27 return kEntrypointMarkerOffsetFromFp; | |
| 28 } | |
| 29 | |
| 30 | |
| 31 uword StackFrame::GetCallerFp() const { | |
| 32 return *(reinterpret_cast<uword*>(fp())); | |
| 33 } | |
| 34 | |
| 35 | |
| 36 uword StackFrame::GetCallerSp() const { | |
| 37 return fp() + kSpOffsetFromPreviousFp; | |
| 38 } | |
| 39 | |
| 40 | |
| 41 intptr_t EntryFrame::ExitLinkOffset() const { | |
| 42 return kExitLinkOffsetInEntryFrame; | |
| 43 } | |
| 44 | |
| 45 | |
| 46 intptr_t EntryFrame::SavedContextOffset() const { | |
| 47 return kSavedContextOffsetInEntryFrame; | |
| 48 } | |
| 49 | |
| 50 | |
| 51 void StackFrameIterator::SetupLastExitFrameData() { | |
| 52 Isolate* current = Isolate::Current(); | |
| 53 uword exit_marker = current->top_exit_frame_info(); | |
| 54 frames_.fp_ = exit_marker; | |
| 55 } | |
| 56 | |
| 57 | |
| 58 void StackFrameIterator::SetupNextExitFrameData() { | |
| 59 uword exit_address = entry_.fp() + kExitLinkOffsetInEntryFrame; | |
| 60 uword exit_marker = *reinterpret_cast<uword*>(exit_address); | |
| 61 frames_.fp_ = exit_marker; | |
| 62 frames_.sp_ = 0; | |
| 63 } | |
| 64 | |
| 65 } // namespace dart | |
| 66 | |
| 67 #endif // defined TARGET_ARCH_MIPS | |
| OLD | NEW |