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

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

Issue 2571843002: VM: [DBC] Fix GetDeoptFpOffset in the presence of materializations. (Closed)
Patch Set: Created 4 years 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 | « no previous file | no next file » | 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) 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/stack_frame.h" 5 #include "vm/stack_frame.h"
6 6
7 #include "platform/memory_sanitizer.h" 7 #include "platform/memory_sanitizer.h"
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/deopt_instructions.h" 9 #include "vm/deopt_instructions.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 } 545 }
546 546
547 547
548 // Finds the potential offset for the current function's FP if the 548 // Finds the potential offset for the current function's FP if the
549 // current frame were to be deoptimized. 549 // current frame were to be deoptimized.
550 intptr_t InlinedFunctionsIterator::GetDeoptFpOffset() const { 550 intptr_t InlinedFunctionsIterator::GetDeoptFpOffset() const {
551 ASSERT(deopt_instructions_.length() != 0); 551 ASSERT(deopt_instructions_.length() != 0);
552 for (intptr_t index = index_; index < deopt_instructions_.length(); index++) { 552 for (intptr_t index = index_; index < deopt_instructions_.length(); index++) {
553 DeoptInstr* deopt_instr = deopt_instructions_[index]; 553 DeoptInstr* deopt_instr = deopt_instructions_[index];
554 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { 554 if (deopt_instr->kind() == DeoptInstr::kCallerFp) {
555 intptr_t fp_offset = (index - num_materializations_);
555 #if defined(TARGET_ARCH_DBC) 556 #if defined(TARGET_ARCH_DBC)
556 // Stack on DBC is growing upwards but we record deopt commands 557 // Stack on DBC is growing upwards but we record deopt commands
557 // in the same order we record them on other architectures as if 558 // in the same order we record them on other architectures as if
558 // the stack was growing downwards. 559 // the stack was growing downwards.
559 return dest_frame_size_ - index; 560 fp_offset = dest_frame_size_ - fp_offset;
560 #else
561 return (index - num_materializations_);
562 #endif 561 #endif
562 return fp_offset;
563 } 563 }
564 } 564 }
565 UNREACHABLE(); 565 UNREACHABLE();
566 return 0; 566 return 0;
567 } 567 }
568 568
569 569
570 #if defined(DEBUG) 570 #if defined(DEBUG)
571 void ValidateFrames() { 571 void ValidateFrames() {
572 StackFrameIterator frames(StackFrameIterator::kValidateFrames); 572 StackFrameIterator frames(StackFrameIterator::kValidateFrames);
573 StackFrame* frame = frames.NextFrame(); 573 StackFrame* frame = frames.NextFrame();
574 while (frame != NULL) { 574 while (frame != NULL) {
575 frame = frames.NextFrame(); 575 frame = frames.NextFrame();
576 } 576 }
577 } 577 }
578 #endif 578 #endif
579 579
580 580
581 } // namespace dart 581 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698