| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 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 | 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 #ifndef VM_STACK_FRAME_H_ | 5 #ifndef VM_STACK_FRAME_H_ |
| 6 #define VM_STACK_FRAME_H_ | 6 #define VM_STACK_FRAME_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 #include "vm/stub_code.h" | 10 #include "vm/stub_code.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 uword GetCallerFp() const { | 126 uword GetCallerFp() const { |
| 127 return *(reinterpret_cast<uword*>( | 127 return *(reinterpret_cast<uword*>( |
| 128 fp() + (kSavedCallerFpSlotFromFp * kWordSize))); | 128 fp() + (kSavedCallerFpSlotFromFp * kWordSize))); |
| 129 } | 129 } |
| 130 | 130 |
| 131 uword GetCallerPc() const { | 131 uword GetCallerPc() const { |
| 132 uword raw_pc = *(reinterpret_cast<uword*>( | 132 uword raw_pc = *(reinterpret_cast<uword*>( |
| 133 fp() + (kSavedCallerPcSlotFromFp * kWordSize))); | 133 fp() + (kSavedCallerPcSlotFromFp * kWordSize))); |
| 134 ASSERT(raw_pc != StubCode::DeoptimizeLazyFromThrow_entry()->EntryPoint()); | 134 ASSERT(raw_pc != StubCode::DeoptimizeLazyFromThrow_entry()->EntryPoint()); |
| 135 if (raw_pc == StubCode::DeoptimizeLazyFromReturn_entry()->EntryPoint()) { | 135 if (raw_pc == StubCode::DeoptimizeLazyFromReturn_entry()->EntryPoint()) { |
| 136 uword fp = GetCallerFp(); | 136 return isolate()->FindPendingDeopt(GetCallerFp()); |
| 137 MallocGrowableArray<PendingLazyDeopt>* pending_deopts = | |
| 138 isolate()->pending_deopts(); | |
| 139 for (intptr_t i = 0; i < pending_deopts->length(); i++) { | |
| 140 if ((*pending_deopts)[i].fp() == fp) { | |
| 141 return (*pending_deopts)[i].pc(); | |
| 142 } | |
| 143 } | |
| 144 FATAL("Missing pending deopt entry"); | |
| 145 } | 137 } |
| 146 return raw_pc; | 138 return raw_pc; |
| 147 } | 139 } |
| 148 | 140 |
| 149 uword fp_; | 141 uword fp_; |
| 150 uword sp_; | 142 uword sp_; |
| 151 uword pc_; | 143 uword pc_; |
| 152 Thread* thread_; | 144 Thread* thread_; |
| 153 | 145 |
| 154 // The iterators FrameSetIterator and StackFrameIterator set the private | 146 // The iterators FrameSetIterator and StackFrameIterator set the private |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 | 401 |
| 410 | 402 |
| 411 DART_FORCE_INLINE static uword LocalVarAddress(uword fp, intptr_t index) { | 403 DART_FORCE_INLINE static uword LocalVarAddress(uword fp, intptr_t index) { |
| 412 return fp + LocalVarIndex(0, index) * kWordSize; | 404 return fp + LocalVarIndex(0, index) * kWordSize; |
| 413 } | 405 } |
| 414 | 406 |
| 415 | 407 |
| 416 } // namespace dart | 408 } // namespace dart |
| 417 | 409 |
| 418 #endif // VM_STACK_FRAME_H_ | 410 #endif // VM_STACK_FRAME_H_ |
| OLD | NEW |