| OLD | NEW |
| 1 // Copyright (c) 2011, 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_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 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 kExitLinkOffsetInEntryFrame = -4 * kWordSize; | 16 static const int kExitLinkOffsetInEntryFrame = -4 * kWordSize; |
| 17 static const int kPcAddressOffsetFromSp = -1 * kWordSize; | 17 static const int kPcAddressOffsetFromSp = -1 * kWordSize; |
| 18 static const int kSpOffsetFromPreviousFp = 2 * kWordSize; | 18 static const int kSpOffsetFromPreviousFp = 2 * kWordSize; |
| 19 | 19 |
| 20 | 20 |
| 21 static bool ExitedFromStub(uword exit_marker) { | 21 static bool ExitedFromStub(uword exit_marker) { |
| 22 if (exit_marker != 0) { | 22 if (exit_marker != 0) { |
| 23 uword caller_pc = *reinterpret_cast<uword*>(exit_marker + kWordSize); | 23 uword caller_pc = *reinterpret_cast<uword*>(exit_marker + kWordSize); |
| 24 uword call_instr_pc = caller_pc - Call::InstructionLength(); | 24 uword call_instr_pc = caller_pc - CallPattern::InstructionLength(); |
| 25 uword call_target = Call(call_instr_pc).TargetAddress(); | 25 uword call_target = CallPattern(call_instr_pc).TargetAddress(); |
| 26 return StubCode::InStubCallToRuntimeStubCode(call_target); | 26 return StubCode::InStubCallToRuntimeStubCode(call_target); |
| 27 } | 27 } |
| 28 return false; | 28 return false; |
| 29 } | 29 } |
| 30 | 30 |
| 31 | 31 |
| 32 intptr_t StackFrame::PcAddressOffsetFromSp() { | 32 intptr_t StackFrame::PcAddressOffsetFromSp() { |
| 33 return kPcAddressOffsetFromSp; | 33 return kPcAddressOffsetFromSp; |
| 34 } | 34 } |
| 35 | 35 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 61 uword exit_address = entry_.fp() + kExitLinkOffsetInEntryFrame; | 61 uword exit_address = entry_.fp() + kExitLinkOffsetInEntryFrame; |
| 62 uword exit_marker = *reinterpret_cast<uword*>(exit_address); | 62 uword exit_marker = *reinterpret_cast<uword*>(exit_address); |
| 63 frames_.fp_ = exit_marker; | 63 frames_.fp_ = exit_marker; |
| 64 frames_.from_stub_exitframe_ = ExitedFromStub(exit_marker); | 64 frames_.from_stub_exitframe_ = ExitedFromStub(exit_marker); |
| 65 frames_.sp_ = 0; | 65 frames_.sp_ = 0; |
| 66 } | 66 } |
| 67 | 67 |
| 68 } // namespace dart | 68 } // namespace dart |
| 69 | 69 |
| 70 #endif // defined TARGET_ARCH_IA32 | 70 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |