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