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

Unified Diff: src/compiler.cc

Issue 5753005: Make closures optimizable by Crankshaft compiler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing next round of Florian's comments Created 10 years 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 | « no previous file | src/flag-definitions.h » ('j') | src/hydrogen.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index e4864e48015df3ef51186b5f814920b6d5364518..88f2d6befb3eea622b9c290346b7a821e2625c0a 100755
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -665,6 +665,14 @@ Handle<SharedFunctionInfo> Compiler::BuildFunctionInfo(FunctionLiteral* literal,
if (!MakeCrankshaftCode(&info)) {
return Handle<SharedFunctionInfo>::null();
}
+ if (FLAG_optimize_closures
+ && !AlwaysFullCompiler()
+ && !info.scope()->HasTrivialOuterContext()
+ && !info.scope()->outer_scope_calls_eval()
+ && !info.scope()->inside_with()) {
+ ASSERT(info.code()->kind() == Code::FUNCTION);
+ info.code()->set_optimizable(true);
+ }
} else {
// The bodies of function literals have not yet been visited by the
// AST optimizer/analyzer.
« no previous file with comments | « no previous file | src/flag-definitions.h » ('j') | src/hydrogen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698