Chromium Code Reviews| 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(); |
| } |
| } |