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. |