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

Unified Diff: runtime/vm/stack_frame.cc

Issue 2176413003: DBC: Fix reading locals out of a deopt frame. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: . Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/stack_frame.h ('k') | runtime/vm/stack_frame_dbc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stack_frame.cc
diff --git a/runtime/vm/stack_frame.cc b/runtime/vm/stack_frame.cc
index 827407d72e91e07d5277f2d18862538481553d52..d9bd0fa679b842e82ac03a27489b2428e3f79dae 100644
--- a/runtime/vm/stack_frame.cc
+++ b/runtime/vm/stack_frame.cc
@@ -489,6 +489,7 @@ EntryFrame* StackFrameIterator::NextEntryFrame() {
InlinedFunctionsIterator::InlinedFunctionsIterator(const Code& code, uword pc)
: index_(0),
num_materializations_(0),
+ dest_frame_size_(0),
code_(Code::Handle(code.raw())),
deopt_info_(TypedData::Handle()),
function_(Function::Handle()),
@@ -512,6 +513,7 @@ InlinedFunctionsIterator::InlinedFunctionsIterator(const Code& code, uword pc)
ASSERT(!deopt_table.IsNull());
DeoptInfo::Unpack(deopt_table, deopt_info_, &deopt_instructions_);
num_materializations_ = DeoptInfo::NumMaterializations(deopt_instructions_);
+ dest_frame_size_ = DeoptInfo::FrameSize(deopt_info_);
object_table_ = code_.GetObjectPool();
Advance();
}
@@ -550,7 +552,14 @@ intptr_t InlinedFunctionsIterator::GetDeoptFpOffset() const {
index++) {
DeoptInstr* deopt_instr = deopt_instructions_[index];
if (deopt_instr->kind() == DeoptInstr::kCallerFp) {
+#if defined(TARGET_ARCH_DBC)
+ // Stack on DBC is growing upwards but we record deopt commands
+ // in the same order we record them on other architectures as if
+ // the stack was growing downwards.
+ return dest_frame_size_ - index;
+#else
return (index - num_materializations_);
+#endif
}
}
UNREACHABLE();
« no previous file with comments | « runtime/vm/stack_frame.h ('k') | runtime/vm/stack_frame_dbc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698