Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: runtime/vm/stack_frame.h

Issue 2396433003: Lazy deopt: (Closed)
Patch Set: . Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/exceptions.cc ('k') | runtime/vm/stack_frame.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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() {
63 // If this frame was marked for lazy deopt, pc_ was computed to be the
64 // original return address using the pending deopts table in GetCallerPc.
65 // Write this value back into the frame.
66 uword original_pc = pc();
67 ASSERT(original_pc !=
68 StubCode::DeoptimizeLazyFromReturn_entry()->EntryPoint());
69 set_pc(original_pc);
70 }
71
54 void set_pc(uword value) { 72 void set_pc(uword value) {
55 *reinterpret_cast<uword*>(sp() + (kSavedPcSlotFromSp * kWordSize)) = value; 73 *reinterpret_cast<uword*>(sp() + (kSavedPcSlotFromSp * kWordSize)) = value;
56 pc_ = value; 74 pc_ = value;
57 } 75 }
58 76
59 void set_pc_marker(RawCode* code) { 77 void set_pc_marker(RawCode* code) {
60 *reinterpret_cast<RawCode**>(fp() + (kPcMarkerSlotFromFp * kWordSize)) = 78 *reinterpret_cast<RawCode**>(fp() + (kPcMarkerSlotFromFp * kWordSize)) =
61 code; 79 code;
62 } 80 }
63 81
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 TypedData& deopt_info_; 373 TypedData& deopt_info_;
356 Function& function_; 374 Function& function_;
357 uword pc_; 375 uword pc_;
358 GrowableArray<DeoptInstr*> deopt_instructions_; 376 GrowableArray<DeoptInstr*> deopt_instructions_;
359 ObjectPool& object_table_; 377 ObjectPool& object_table_;
360 378
361 DISALLOW_COPY_AND_ASSIGN(InlinedFunctionsIterator); 379 DISALLOW_COPY_AND_ASSIGN(InlinedFunctionsIterator);
362 }; 380 };
363 381
364 382
383 #if defined(DEBUG)
384 void ValidateFrames();
385 #endif
386
387
365 #if !defined(TARGET_ARCH_DBC) 388 #if !defined(TARGET_ARCH_DBC)
366 DART_FORCE_INLINE static intptr_t LocalVarIndex(intptr_t fp_offset, 389 DART_FORCE_INLINE static intptr_t LocalVarIndex(intptr_t fp_offset,
367 intptr_t var_index) { 390 intptr_t var_index) {
368 return fp_offset + var_index; 391 return fp_offset + var_index;
369 } 392 }
370 393
371 394
372 DART_FORCE_INLINE static uword ParamAddress(uword fp, intptr_t reverse_index) { 395 DART_FORCE_INLINE static uword ParamAddress(uword fp, intptr_t reverse_index) {
373 return fp + (kParamEndSlotFromFp * kWordSize) + (reverse_index * kWordSize); 396 return fp + (kParamEndSlotFromFp * kWordSize) + (reverse_index * kWordSize);
374 } 397 }
(...skipping 11 matching lines...) Expand all
386 409
387 410
388 DART_FORCE_INLINE static uword LocalVarAddress(uword fp, intptr_t index) { 411 DART_FORCE_INLINE static uword LocalVarAddress(uword fp, intptr_t index) {
389 return fp + LocalVarIndex(0, index) * kWordSize; 412 return fp + LocalVarIndex(0, index) * kWordSize;
390 } 413 }
391 414
392 415
393 } // namespace dart 416 } // namespace dart
394 417
395 #endif // VM_STACK_FRAME_H_ 418 #endif // VM_STACK_FRAME_H_
OLDNEW
« no previous file with comments | « runtime/vm/exceptions.cc ('k') | runtime/vm/stack_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698