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

Unified Diff: runtime/vm/code_generator.cc

Issue 1413233004: nt # Enter a description of the change. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: c Created 5 years, 2 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/compiler.cc » ('j') | runtime/vm/flow_graph_compiler.cc » ('J')
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 41175a72f4e4da6ec19ea601d977ff216b75549a..9cf6ae0d416a271e8b0d3a6849c537a797a9b994 100644
--- a/runtime/vm/code_generator.cc
+++ b/runtime/vm/code_generator.cc
@@ -1450,8 +1450,9 @@ DEFINE_RUNTIME_ENTRY(OptimizeInvokedFunction, 1) {
if (CanOptimizeFunction(function, isolate)) {
// Reset usage counter for reoptimization before calling optimizer to
// prevent recursive triggering of function optimization.
siva 2015/10/21 17:35:09 This comment has to move down to the place where t
srdjan 2015/10/21 17:45:33 Done.
- function.set_usage_counter(0);
if (FLAG_background_compilation) {
+ // Prevent from being triggered again.
siva 2015/10/21 17:35:09 Can you add a comment here that INT_MIN ensures th
srdjan 2015/10/21 17:45:33 Done.
+ function.set_usage_counter(INT_MIN);
BackgroundCompiler::EnsureInit(thread);
ASSERT(isolate->background_compiler() != NULL);
isolate->background_compiler()->CompileOptimized(function);
@@ -1459,6 +1460,8 @@ DEFINE_RUNTIME_ENTRY(OptimizeInvokedFunction, 1) {
arguments.SetReturn(Code::Handle(zone, function.CurrentCode()));
return;
}
+
+ function.set_usage_counter(0);
if (FLAG_trace_compiler) {
if (function.HasOptimizedCode()) {
THR_Print("ReCompiling function: '%s' \n",
« no previous file with comments | « no previous file | runtime/vm/compiler.cc » ('j') | runtime/vm/flow_graph_compiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698