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

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: avoid default arguments by using pending_deoptimization_env_ 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
Index: runtime/vm/stack_frame.cc
===================================================================
--- runtime/vm/stack_frame.cc (revision 17448)
+++ runtime/vm/stack_frame.cc (working copy)
@@ -285,6 +285,7 @@
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());
@@ -292,11 +293,18 @@
func_ = code.function();
intptr_t deopt_reason = kDeoptUnknown;
deopt_info_ = code.GetDeoptInfoAtPc(frame_->pc(), &deopt_reason);
+
+ // 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_);
siva 2013/01/28 22:46:55 Is this some kind of code hoisting optimization yo
Florian Schneider 2013/01/29 12:19:07 No, this is not for optimization purposes: The raw
+
object_table_ = code.object_table();
}
-RawFunction* InlinedFunctionsInDartFrameIterator::GetNextFunction(uword* pc) {
+RawFunction* InlinedFunctionsInDartFrameIterator::GetNextFunction(uword* pc,
+ Code* code) {
siva 2013/01/28 22:46:55 I try and avoid functions which have two return va
Florian Schneider 2013/01/29 12:19:07 I agree. I'll get rid of one output parameter and
if (index_ == -1) {
return Function::null();
}
@@ -305,21 +313,22 @@
// inlined functions to iterate over, we return the function.
index_ = -1; // No more functions.
*pc = frame_->pc();
+ *code = func_.CurrentCode();
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()) {
+ ASSERT(deopt_instructions_.length() != 0);
+ while (index_ < deopt_instructions_.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,
+ DeoptInstr* deopt_instr = deopt_instructions_[cur_index];
+ ASSERT(deopt_instr->kind() != DeoptInstr::kRetBeforeAddress);
+ if (deopt_instr->kind() == DeoptInstr::kRetAfterAddress) {
+ *pc = DeoptInstr::GetRetAfterAddress(deopt_instr,
object_table_,
&func_);
+ *code = func_.unoptimized_code();
return func_.raw();
}
}

Powered by Google App Engine
This is Rietveld 408576698