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

Unified Diff: runtime/vm/object.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/object.h ('k') | runtime/vm/stack_frame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 16999)
+++ runtime/vm/object.cc (working copy)
@@ -7148,6 +7148,30 @@
}
+RawDeoptInfo* Code::GetDeoptInfoAtPc(uword pc, intptr_t* deopt_reason) const {
+ ASSERT(is_optimized());
+ const Instructions& instrs = Instructions::Handle(instructions());
+ uword code_entry = instrs.EntryPoint();
+ const Array& table = Array::Handle(deopt_info_array());
+ ASSERT(!table.IsNull());
+ // Linear search for the PC offset matching the target PC.
+ intptr_t length = DeoptTable::GetLength(table);
+ Smi& offset = Smi::Handle();
+ Smi& reason = Smi::Handle();
+ DeoptInfo& info = DeoptInfo::Handle();
+ for (intptr_t i = 0; i < length; ++i) {
+ DeoptTable::GetEntry(table, i, &offset, &info, &reason);
+ if (pc == (code_entry + offset.Value())) {
+ ASSERT(!info.IsNull());
+ *deopt_reason = reason.Value();
+ return info.raw();
+ }
+ }
+ *deopt_reason = kDeoptUnknown;
+ return DeoptInfo::null();
+}
+
+
RawFunction* Code::GetStaticCallTargetFunctionAt(uword pc) const {
RawObject* raw_code_offset =
reinterpret_cast<RawObject*>(Smi::New(pc - EntryPoint()));
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/stack_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698