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

Unified Diff: runtime/vm/stack_frame.cc

Issue 12049039: Fix source position for stack traces with optimized top function. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: rebase Created 7 years, 11 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') | tests/language/language_dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stack_frame.cc
===================================================================
--- runtime/vm/stack_frame.cc (revision 17754)
+++ runtime/vm/stack_frame.cc (working copy)
@@ -282,16 +282,21 @@
InlinedFunctionsInDartFrameIterator::InlinedFunctionsInDartFrameIterator(
StackFrame* frame) : index_(0),
- frame_(frame),
- func_(Function::Handle()),
- deopt_info_(DeoptInfo::Handle()),
+ deopt_instructions_(),
object_table_(Array::Handle()) {
- ASSERT(frame_ != NULL);
- const Code& code = Code::Handle(frame_->LookupDartCode());
+ ASSERT(frame != NULL);
+ const Code& code = Code::Handle(frame->LookupDartCode());
ASSERT(code.is_optimized());
- func_ = code.function();
intptr_t deopt_reason = kDeoptUnknown;
- deopt_info_ = code.GetDeoptInfoAtPc(frame_->pc(), &deopt_reason);
+ const DeoptInfo& deopt_info = DeoptInfo::Handle(
+ code.GetDeoptInfoAtPc(frame->pc(), &deopt_reason));
+ ASSERT(!deopt_info.IsNull());
+
+ // Unpack deopt info into instructions (translate away suffixes).
+ const Array& deopt_table = Array::Handle(code.deopt_info_array());
+ ASSERT(!deopt_table.IsNull());
+ deopt_info.ToInstructions(deopt_table, &deopt_instructions_);
+
object_table_ = code.object_table();
}
@@ -300,27 +305,19 @@
if (index_ == -1) {
return Function::null();
}
- if (deopt_info_.IsNull()) {
- // We are at a PC that has no deoptimization info so there are no
- // inlined functions to iterate over, we return the function.
- index_ = -1; // No more functions.
- *pc = frame_->pc();
- return func_.raw();
- }
+
// Iterate over the deopt instructions and determine the inlined
// functions if any and iterate over them.
- ASSERT(deopt_info_.Length() != 0);
- while (index_ < deopt_info_.Length()) {
- intptr_t cur_index = index_;
- index_ += 1;
- intptr_t deopt_instr = deopt_info_.Instruction(cur_index);
- ASSERT(deopt_instr != DeoptInstr::kRetBeforeAddress);
- if (deopt_instr == DeoptInstr::kRetAfterAddress) {
- intptr_t deopt_from_index = deopt_info_.FromIndex(cur_index);
- *pc = DeoptInstr::GetRetAfterAddress(deopt_from_index,
+ Function& func = Function::Handle();
+ ASSERT(deopt_instructions_.length() != 0);
+ while (index_ < deopt_instructions_.length()) {
+ DeoptInstr* deopt_instr = deopt_instructions_[index_++];
+ ASSERT(deopt_instr->kind() != DeoptInstr::kRetBeforeAddress);
+ if (deopt_instr->kind() == DeoptInstr::kRetAfterAddress) {
+ *pc = DeoptInstr::GetRetAfterAddress(deopt_instr,
object_table_,
- &func_);
- return func_.raw();
+ &func);
+ return func.raw();
}
}
index_ = -1;
« no previous file with comments | « runtime/vm/stack_frame.h ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698