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

Unified Diff: runtime/vm/code_generator.cc

Issue 11783066: Optimize function at its entry instead of at exit. (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 | « no previous file | runtime/vm/code_patcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator.cc
===================================================================
--- runtime/vm/code_generator.cc (revision 16874)
+++ runtime/vm/code_generator.cc (working copy)
@@ -1339,15 +1339,18 @@
// This is called from function that needs to be optimized.
// The requesting function can be already optimized (reoptimization).
+// Returns the Code object where to continue execution.
DEFINE_RUNTIME_ENTRY(OptimizeInvokedFunction, 1) {
ASSERT(arguments.ArgCount() ==
kOptimizeInvokedFunctionRuntimeEntry.argument_count());
const intptr_t kLowInvocationCount = -100000000;
const Function& function = Function::CheckedHandle(arguments.ArgAt(0));
+ ASSERT(!function.IsNull());
if (isolate->debugger()->HasBreakpoint(function)) {
// We cannot set breakpoints in optimized code, so do not optimize
// the function.
function.set_usage_counter(0);
+ arguments.SetReturn(Code::Handle(function.CurrentCode()));
return;
}
if (function.deoptimization_counter() >=
@@ -1357,12 +1360,14 @@
}
// TODO(srdjan): Investigate excessive deoptimization.
function.set_usage_counter(kLowInvocationCount);
+ arguments.SetReturn(Code::Handle(function.CurrentCode()));
return;
}
if ((FLAG_optimization_filter != NULL) &&
(strstr(function.ToFullyQualifiedCString(),
FLAG_optimization_filter) == NULL)) {
function.set_usage_counter(kLowInvocationCount);
+ arguments.SetReturn(Code::Handle(function.CurrentCode()));
return;
}
if (function.is_optimizable()) {
@@ -1383,6 +1388,7 @@
// TODO(5442338): Abort as this should not happen.
function.set_usage_counter(kLowInvocationCount);
}
+ arguments.SetReturn(Code::Handle(function.CurrentCode()));
}
« no previous file with comments | « no previous file | runtime/vm/code_patcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698