OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011, 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_ARM) | |
7 | |
8 #include "vm/instructions.h" | |
9 #include "vm/isolate.h" | |
10 #include "vm/stack_frame.h" | |
11 | |
12 namespace dart { | |
13 | |
14 // The constant kExitLinkOffsetInEntryFrame must be kept in sync with the | |
15 // code in the InvokeDartCode stub. | |
16 static const int kSavedContextOffsetInEntryFrame = -10 * kWordSize; | |
17 static const int kExitLinkOffsetInEntryFrame = -9 * kWordSize; | |
18 static const int kPcAddressOffsetFromSp = -2 * kWordSize; | |
19 static const int kEntrypointMarkerOffsetFromFp = 2 * kWordSize; | |
20 static const int kSpOffsetFromPreviousFp = 3 * kWordSize; | |
21 | |
22 | |
23 intptr_t StackFrame::PcAddressOffsetFromSp() { | |
24 return kPcAddressOffsetFromSp; | |
25 } | |
26 | |
27 | |
28 intptr_t StackFrame::EntrypointMarkerOffsetFromFp() { | |
29 return kEntrypointMarkerOffsetFromFp; | |
30 } | |
31 | |
32 | |
33 uword StackFrame::GetCallerSp() const { | |
34 return fp() + kSpOffsetFromPreviousFp; | |
35 } | |
36 | |
37 | |
38 uword StackFrame::GetCallerFp() const { | |
39 return *(reinterpret_cast<uword*>(fp())); | |
40 } | |
41 | |
42 | |
43 intptr_t EntryFrame::ExitLinkOffset() const { | |
44 return kExitLinkOffsetInEntryFrame; | |
45 } | |
46 | |
47 | |
48 intptr_t EntryFrame::SavedContextOffset() const { | |
49 return kSavedContextOffsetInEntryFrame; | |
50 } | |
51 | |
52 | |
53 void StackFrameIterator::SetupLastExitFrameData() { | |
54 Isolate* current = Isolate::Current(); | |
55 uword exit_marker = current->top_exit_frame_info(); | |
56 frames_.fp_ = exit_marker; | |
57 } | |
58 | |
59 | |
60 void StackFrameIterator::SetupNextExitFrameData() { | |
61 uword exit_address = entry_.fp() + kExitLinkOffsetInEntryFrame; | |
62 uword exit_marker = *reinterpret_cast<uword*>(exit_address); | |
63 frames_.fp_ = exit_marker; | |
64 frames_.sp_ = 0; | |
65 } | |
66 | |
67 } // namespace dart | |
68 | |
69 #endif // defined(TARGET_ARCH_ARM) | |
OLD | NEW |