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

Unified Diff: runtime/vm/code_generator.cc

Issue 226303002: Begin implementing flag --deoptimize-filter=FUNC for ia32. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 | « no previous file | runtime/vm/flow_graph_compiler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator.cc
diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc
index 7e96333cb67938709e21e6c212f31826b218adc0..2c5869dcb004a5403c94ceb504aa95e4ec28873b 100644
--- a/runtime/vm/code_generator.cc
+++ b/runtime/vm/code_generator.cc
@@ -60,6 +60,8 @@ DECLARE_FLAG(bool, report_usage_count);
DEFINE_FLAG(bool, use_osr, true, "Use on-stack replacement.");
DEFINE_FLAG(bool, trace_osr, false, "Trace attempts at on-stack replacement.");
+DECLARE_FLAG(charp, deoptimize_filter);
+
DEFINE_RUNTIME_ENTRY(TraceFunctionEntry, 1) {
const Function& function = Function::CheckedHandle(arguments.ArgAt(0));
@@ -1223,6 +1225,26 @@ DEFINE_RUNTIME_ENTRY(StackOverflow, 0) {
frame->set_pc(optimized_entry);
}
}
+
+ if (FLAG_deoptimize_filter != NULL) {
+ DartFrameIterator iterator;
+ StackFrame* frame = iterator.NextFrame();
+ ASSERT(frame != NULL);
+ const Code& code = Code::ZoneHandle(frame->LookupDartCode());
srdjan 2014/04/04 17:55:23 'code' can be Code::Handle as code does not escape
+ ASSERT(!code.IsNull());
+ if (code.is_optimized()) {
+ const Function& function = Function::Handle(code.function());
+ ASSERT(!function.IsNull());
+ if (strstr(function.ToFullyQualifiedCString(),
+ FLAG_deoptimize_filter) != NULL) {
+ if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) {
+ OS::PrintErr("*** Forcing deoptimization (%s)\n",
+ function.ToFullyQualifiedCString());
+ DeoptimizeAll();
+ }
+ }
+ }
+ }
}
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698