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

Unified Diff: runtime/vm/code_generator.cc

Issue 10421028: When methods cannot be optimized initialize their count to a large negative number, otherwise they … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« no previous file with comments | « no previous file | no next file » | 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 7887)
+++ runtime/vm/code_generator.cc (working copy)
@@ -1316,6 +1316,7 @@
// Once the invocation counter threshold is reached any entry into the
// unoptimized code is redirected to this function.
DEFINE_RUNTIME_ENTRY(OptimizeInvokedFunction, 1) {
+ const intptr_t kLowInvocationCount = -100000000;
siva 2012/05/24 23:44:22 Why this value and not kIntptrMin....
srdjan 2012/05/24 23:57:22 It must be a Smi, could have been MinSmi but this
ASSERT(arguments.Count() ==
kOptimizeInvokedFunctionRuntimeEntry.argument_count());
const Function& function = Function::CheckedHandle(arguments.At(0));
@@ -1328,7 +1329,7 @@
if (function.deoptimization_counter() >=
FLAG_deoptimization_counter_threshold) {
// TODO(srdjan): Investigate excessive deoptimization.
- function.set_usage_counter(0);
+ function.set_usage_counter(kLowInvocationCount);
return;
}
if (function.HasOptimizedCode()) {
@@ -1337,7 +1338,7 @@
// a loop. Maybe test if the code has been optimized before calling.
// If this happens from optimized code, then it means that the optimized
// code needs to be reoptimized.
- function.set_usage_counter(0);
+ function.set_usage_counter(kLowInvocationCount);
return;
}
if (function.is_optimizable()) {
@@ -1354,7 +1355,7 @@
ASSERT(!unoptimized_code.IsNull());
} else {
// TODO(5442338): Abort as this should not happen.
- function.set_usage_counter(0);
+ function.set_usage_counter(kLowInvocationCount);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698