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

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
« no previous file with comments | « src/compiler.cc ('k') | src/heap.cc » ('j') | src/heap.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index cccc3e76297b20a2ade4272efcd978e7d0c2f06b..7d383551fc8c4fb9f2ba0e3aa23b6eca3ff30016 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -733,6 +733,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() &&
« no previous file with comments | « src/compiler.cc ('k') | src/heap.cc » ('j') | src/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698