Index: src/compiler.cc |
diff --git a/src/compiler.cc b/src/compiler.cc |
index 1ec4414ad3eb0e8517e2f9e19de8a2fe7da0a9a4..e8bf784fc46fa09b43d511f02672399231f8461c 100755 |
--- a/src/compiler.cc |
+++ b/src/compiler.cc |
@@ -1,4 +1,4 @@ |
-// Copyright 2010 the V8 project authors. All rights reserved. |
+// Copyright 2011 the V8 project authors. All rights reserved. |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
// met: |
@@ -326,30 +326,9 @@ static bool MakeCode(CompilationInfo* info) { |
if (Rewriter::Rewrite(info) && Scope::Analyze(info)) { |
if (V8::UseCrankshaft()) return MakeCrankshaftCode(info); |
- |
- // Generate code and return it. Code generator selection is governed by |
- // which backends are enabled and whether the function is considered |
- // run-once code or not. |
- // |
- // --full-compiler enables the dedicated backend for code we expect to |
- // be run once |
- // |
- // The normal choice of backend can be overridden with the flags |
- // --always-full-compiler. |
- if (Rewriter::Analyze(info)) { |
- Handle<SharedFunctionInfo> shared = info->shared_info(); |
- bool is_run_once = (shared.is_null()) |
- ? info->scope()->is_global_scope() |
- : (shared->is_toplevel() || shared->try_full_codegen()); |
- bool can_use_full = |
- FLAG_full_compiler && !info->function()->contains_loops(); |
- if (AlwaysFullCompiler() || (is_run_once && can_use_full)) { |
- return FullCodeGenerator::MakeCode(info); |
- } else { |
- return AssignedVariablesAnalyzer::Analyze(info) && |
- CodeGenerator::MakeCode(info); |
- } |
- } |
+ // If crankshaft is not supported fall back to full code generator |
+ // for all compilation. |
+ return FullCodeGenerator::MakeCode(info); |
} |
return false; |
@@ -727,23 +706,8 @@ Handle<SharedFunctionInfo> Compiler::BuildFunctionInfo(FunctionLiteral* literal, |
return Handle<SharedFunctionInfo>::null(); |
} |
} else { |
- // The bodies of function literals have not yet been visited by the |
- // AST optimizer/analyzer. |
- if (!Rewriter::Analyze(&info)) return Handle<SharedFunctionInfo>::null(); |
- |
- bool is_run_once = literal->try_full_codegen(); |
- bool can_use_full = FLAG_full_compiler && !literal->contains_loops(); |
- |
- if (AlwaysFullCompiler() || (is_run_once && can_use_full)) { |
- if (!FullCodeGenerator::MakeCode(&info)) { |
- return Handle<SharedFunctionInfo>::null(); |
- } |
- } else { |
- // We fall back to the classic V8 code generator. |
- if (!AssignedVariablesAnalyzer::Analyze(&info) || |
- !CodeGenerator::MakeCode(&info)) { |
- return Handle<SharedFunctionInfo>::null(); |
- } |
+ if (!FullCodeGenerator::MakeCode(&info)) { |
+ return Handle<SharedFunctionInfo>::null(); |
} |
} |
ASSERT(!info.code().is_null()); |
@@ -791,7 +755,6 @@ void Compiler::SetFunctionInfo(Handle<SharedFunctionInfo> function_info, |
function_info->SetThisPropertyAssignmentsInfo( |
lit->has_only_simple_this_property_assignments(), |
*lit->this_property_assignments()); |
- function_info->set_try_full_codegen(lit->try_full_codegen()); |
function_info->set_allows_lazy_compilation(lit->AllowsLazyCompilation()); |
function_info->set_strict_mode(lit->strict_mode()); |
} |