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

Unified Diff: src/factory.cc

Issue 699633002: Optimize function across closures. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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/hydrogen-instructions.h » ('j') | no next file with comments »
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 72974a317c18646800178b4c10340a85b444afcf..658702a66ee91d8c90d73e4dd9a288c1b079aa5a 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1358,6 +1358,14 @@ Handle<JSObject> Factory::NewFunctionPrototype(Handle<JSFunction> function) {
}
+static bool ShouldOptimizeNewClosure(Isolate* isolate,
+ Handle<SharedFunctionInfo> info) {
+ return isolate->use_crankshaft() && !info->is_toplevel() &&
+ info->allows_lazy_compilation() && !info->optimization_disabled() &&
+ !isolate->DebuggerHasBreakPoints();
+}
+
+
Handle<JSFunction> Factory::NewFunctionFromSharedFunctionInfo(
Handle<SharedFunctionInfo> info,
Handle<Context> context,
@@ -1395,14 +1403,15 @@ Handle<JSFunction> Factory::NewFunctionFromSharedFunctionInfo(
return result;
}
- if (isolate()->use_crankshaft() &&
- FLAG_always_opt &&
- result->is_compiled() &&
- !info->is_toplevel() &&
- info->allows_lazy_compilation() &&
- !info->optimization_disabled() &&
- !isolate()->DebuggerHasBreakPoints()) {
+ if (FLAG_always_opt && ShouldOptimizeNewClosure(isolate(), info)) {
result->MarkForOptimization();
+ } else if (info->optimize_next_closure() &&
+ ShouldOptimizeNewClosure(isolate(), info)) {
+ if (isolate()->concurrent_recompilation_enabled()) {
+ result->MarkForConcurrentOptimization();
+ } else {
+ result->MarkForOptimization();
+ }
}
return result;
}
« no previous file with comments | « src/compiler.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698