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

Unified Diff: src/factory.cc

Issue 59823002: Reset opt count on optimized code map lookup failure. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 400132e14b520f1bf5ff7992d4c59e090d9dde88..39a1795d3e950dab49f4b13feea8fb2311c0abd2 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -711,6 +711,12 @@ Handle<JSFunction> Factory::NewFunctionFromSharedFunctionInfo(
// Caching of optimized code enabled and optimized code found.
function_info->InstallFromOptimizedCodeMap(*result, index);
return result;
+ } else {
+ // The optimization count should be tied to the context, similar to the
+ // optimized code map. But for simplicity's sake we just reset the opt
+ // count whenever the optimized code map lookup fails. This happens
+ // only when the function has never been optimized for the current context.
+ function_info->set_opt_count(0);
}
if (isolate()->use_crankshaft() &&

Powered by Google App Engine
This is Rietveld 408576698