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

Unified Diff: src/compiler.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/compiler.cc
===================================================================
--- src/compiler.cc (revision 10399)
+++ src/compiler.cc (working copy)
@@ -142,8 +142,6 @@
static void FinishOptimization(Handle<JSFunction> function, int64_t start) {
- int opt_count = function->shared()->opt_count();
- function->shared()->set_opt_count(opt_count + 1);
double ms = static_cast<double>(OS::Ticks() - start) / 1000;
if (FLAG_trace_opt) {
PrintF("[optimizing: ");
@@ -199,19 +197,6 @@
return true;
}
- // Limit the number of times we re-compile a functions with
- // the optimizing compiler.
- const int kMaxOptCount =
- FLAG_deopt_every_n_times == 0 ? Compiler::kDefaultMaxOptCount : 1000;
- if (info->shared_info()->opt_count() > kMaxOptCount) {
- info->AbortOptimization();
- Handle<JSFunction> closure = info->closure();
- info->shared_info()->DisableOptimization(*closure);
- // True indicates the compilation pipeline is still going, not
- // necessarily that we optimized the code.
- return true;
- }
-
// Due to an encoding limit on LUnallocated operands in the Lithium
// language, we cannot optimize functions with too many formal parameters
// or perform on-stack replacement for function with too many
@@ -226,8 +211,7 @@
(info->osr_ast_id() != AstNode::kNoNumber &&
scope->num_parameters() + 1 + scope->num_stack_slots() > locals_limit)) {
info->AbortOptimization();
- Handle<JSFunction> closure = info->closure();
- info->shared_info()->DisableOptimization(*closure);
+ info->shared_info()->DisableOptimization();
// True indicates the compilation pipeline is still going, not
// necessarily that we optimized the code.
return true;
@@ -305,8 +289,7 @@
if (!builder.inline_bailout()) {
// Mark the shared code as unoptimizable unless it was an inlined
// function that bailed out.
- Handle<JSFunction> closure = info->closure();
- info->shared_info()->DisableOptimization(*closure);
+ info->shared_info()->DisableOptimization();
}
// True indicates the compilation pipeline is still going, not necessarily
// that we optimized the code.

Powered by Google App Engine
This is Rietveld 408576698