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

Unified Diff: runtime/vm/deopt_instructions.cc

Issue 15779006: Add deoptimization history to optimized functions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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/deopt_instructions.cc
===================================================================
--- runtime/vm/deopt_instructions.cc (revision 23072)
+++ runtime/vm/deopt_instructions.cc (working copy)
@@ -16,6 +16,7 @@
DEFINE_FLAG(bool, compress_deopt_info, true,
"Compress the size of the deoptimization info for optimized code.");
DECLARE_FLAG(bool, trace_deoptimization);
+DECLARE_FLAG(bool, trace_deoptimization_verbose);
DeoptimizationContext::DeoptimizationContext(intptr_t* to_frame_start,
intptr_t to_frame_size,
@@ -283,6 +284,18 @@
ic_data.set_deopt_reason(deopt_context->deopt_reason());
}
}
+
+ const Array& deopt_history = Array::Handle(function.deopt_history());
+ ASSERT(!deopt_history.IsNull());
+ intptr_t count = function.deoptimization_counter();
+ ASSERT(count > 0);
+ if (count <= deopt_history.Length()) {
+ deopt_history.SetAt(count - 1, Smi::Handle(Smi::New(deopt_id_)));
+ if (FLAG_trace_deoptimization_verbose) {
+ OS::Print(" adding id %"Pd" to history at %"Pd"\n",
+ deopt_id_, count - 1);
+ }
+ }
}
intptr_t object_table_index() const { return object_table_index_; }

Powered by Google App Engine
This is Rietveld 408576698