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

Unified Diff: runtime/vm/stack_frame.cc

Issue 11833025: Fix for issue 7757 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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') | no next file » | 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 16999)
+++ runtime/vm/stack_frame.cc (working copy)
@@ -5,6 +5,7 @@
#include "vm/stack_frame.h"
#include "vm/assembler_macros.h"
+#include "vm/deopt_instructions.h"
#include "vm/isolate.h"
#include "vm/object.h"
#include "vm/object_store.h"
@@ -288,4 +289,52 @@
return &entry_;
}
+
+InlinedFunctionsInDartFrameIterator::InlinedFunctionsInDartFrameIterator(
+ StackFrame* frame) : index_(0),
+ frame_(frame),
+ func_(Function::Handle()),
+ deopt_info_(DeoptInfo::Handle()),
+ object_table_(Array::Handle()) {
+ 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);
+ object_table_ = code.object_table();
+}
+
+
+RawFunction* InlinedFunctionsInDartFrameIterator::GetNextFunction(uword* pc) {
+ 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,
+ object_table_,
+ &func_);
+ return func_.raw();
+ }
+ }
+ index_ = -1;
+ return Function::null();
+}
+
} // namespace dart
« no previous file with comments | « runtime/vm/stack_frame.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698