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

Unified Diff: src/runtime.cc

Issue 9207002: Add a deoptimization count to each function to limit number of re-compilations. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 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
Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 10399)
+++ src/runtime.cc (working copy)
@@ -8464,6 +8464,9 @@
PrintF("]\n");
}
function->ReplaceCode(function->shared()->code());
+
+ // Limit the number of times we re-compile a functions after deoptimization.
+ function->shared()->IncrementAndCheckDeoptCount();
} else {
Deoptimizer::DeoptimizeFunction(*function);
}
@@ -8526,11 +8529,11 @@
}
-RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationCount) {
+RUNTIME_FUNCTION(MaybeObject*, Runtime_GetDeoptimizationCount) {
HandleScope scope(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSFunction, function, 0);
- return Smi::FromInt(function->shared()->opt_count());
+ return Smi::FromInt(function->shared()->deopt_count());
}

Powered by Google App Engine
This is Rietveld 408576698