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

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: Rebasing to ToT Created 9 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
« no previous file with comments | « no previous file | src/flag-definitions.h » ('j') | no next file with comments »
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)) {
Kevin Millikin (Chromium) 2011/01/14 12:48:59 The code here is confusing. From my reading of th
return Handle<SharedFunctionInfo>::null();
}
+ if (FLAG_optimize_closures
+ && !AlwaysFullCompiler()
Kevin Millikin (Chromium) 2011/01/14 12:48:59 I'm not sure all these checks are necessary. I wo
+ && !info.scope()->HasTrivialOuterContext()
+ && !info.scope()->outer_scope_calls_eval()
+ && !info.scope()->inside_with()) {
+ ASSERT(info.code()->kind() == Code::FUNCTION);
+ info.code()->set_optimizable(true);
Kevin Millikin (Chromium) 2011/01/14 12:48:59 Then, I'm not a fan of compiling with non-optimiza
+ }
} 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698