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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
44 | 44 |
45 // The pool pointer is not implemented on all architectures. | 45 // The pool pointer is not implemented on all architectures. |
46 static int SavedCallerPpSlotFromFp() { | 46 static int SavedCallerPpSlotFromFp() { |
47 if (kSavedCallerPpSlotFromFp != kSavedCallerFpSlotFromFp) { | 47 if (kSavedCallerPpSlotFromFp != kSavedCallerFpSlotFromFp) { |
48 return kSavedCallerPpSlotFromFp; | 48 return kSavedCallerPpSlotFromFp; |
49 } | 49 } |
50 UNREACHABLE(); | 50 UNREACHABLE(); |
51 return 0; | 51 return 0; |
52 } | 52 } |
53 | 53 |
54 uword IsMarkedForLazyDeopt() const { | |
55 uword raw_pc = *reinterpret_cast<uword*>( | |
56 sp() + (kSavedPcSlotFromSp * kWordSize)); | |
57 return raw_pc == StubCode::DeoptimizeLazyFromReturn_entry()->EntryPoint(); | |
58 } | |
59 void MarkForLazyDeopt() { | |
60 set_pc(StubCode::DeoptimizeLazyFromReturn_entry()->EntryPoint()); | |
61 } | |
62 void UnmarkForLazyDeopt() { | |
Florian Schneider
2016/10/04 21:32:41
This reads a little weird: Maybe comment that pc_
rmacnak
2016/10/04 22:11:28
Added comment and assert. Can't use GetCallerPc h
| |
63 set_pc(pc()); | |
64 } | |
65 | |
54 void set_pc(uword value) { | 66 void set_pc(uword value) { |
55 *reinterpret_cast<uword*>(sp() + (kSavedPcSlotFromSp * kWordSize)) = value; | 67 *reinterpret_cast<uword*>(sp() + (kSavedPcSlotFromSp * kWordSize)) = value; |
56 pc_ = value; | 68 pc_ = value; |
57 } | 69 } |
58 | 70 |
59 void set_pc_marker(RawCode* code) { | 71 void set_pc_marker(RawCode* code) { |
60 *reinterpret_cast<RawCode**>(fp() + (kPcMarkerSlotFromFp * kWordSize)) = | 72 *reinterpret_cast<RawCode**>(fp() + (kPcMarkerSlotFromFp * kWordSize)) = |
61 code; | 73 code; |
62 } | 74 } |
63 | 75 |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
355 TypedData& deopt_info_; | 367 TypedData& deopt_info_; |
356 Function& function_; | 368 Function& function_; |
357 uword pc_; | 369 uword pc_; |
358 GrowableArray<DeoptInstr*> deopt_instructions_; | 370 GrowableArray<DeoptInstr*> deopt_instructions_; |
359 ObjectPool& object_table_; | 371 ObjectPool& object_table_; |
360 | 372 |
361 DISALLOW_COPY_AND_ASSIGN(InlinedFunctionsIterator); | 373 DISALLOW_COPY_AND_ASSIGN(InlinedFunctionsIterator); |
362 }; | 374 }; |
363 | 375 |
364 | 376 |
377 void ValidateFrames(); | |
Florian Schneider
2016/10/04 21:32:41
#ifdef DEBUG
rmacnak
2016/10/04 22:11:28
Done.
| |
378 | |
379 | |
365 #if !defined(TARGET_ARCH_DBC) | 380 #if !defined(TARGET_ARCH_DBC) |
366 DART_FORCE_INLINE static intptr_t LocalVarIndex(intptr_t fp_offset, | 381 DART_FORCE_INLINE static intptr_t LocalVarIndex(intptr_t fp_offset, |
367 intptr_t var_index) { | 382 intptr_t var_index) { |
368 return fp_offset + var_index; | 383 return fp_offset + var_index; |
369 } | 384 } |
370 | 385 |
371 | 386 |
372 DART_FORCE_INLINE static uword ParamAddress(uword fp, intptr_t reverse_index) { | 387 DART_FORCE_INLINE static uword ParamAddress(uword fp, intptr_t reverse_index) { |
373 return fp + (kParamEndSlotFromFp * kWordSize) + (reverse_index * kWordSize); | 388 return fp + (kParamEndSlotFromFp * kWordSize) + (reverse_index * kWordSize); |
374 } | 389 } |
(...skipping 11 matching lines...) Expand all Loading... | |
386 | 401 |
387 | 402 |
388 DART_FORCE_INLINE static uword LocalVarAddress(uword fp, intptr_t index) { | 403 DART_FORCE_INLINE static uword LocalVarAddress(uword fp, intptr_t index) { |
389 return fp + LocalVarIndex(0, index) * kWordSize; | 404 return fp + LocalVarIndex(0, index) * kWordSize; |
390 } | 405 } |
391 | 406 |
392 | 407 |
393 } // namespace dart | 408 } // namespace dart |
394 | 409 |
395 #endif // VM_STACK_FRAME_H_ | 410 #endif // VM_STACK_FRAME_H_ |
OLD | NEW |