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", |