Index: src/compiler.cc |
=================================================================== |
--- src/compiler.cc (revision 4715) |
+++ src/compiler.cc (working copy) |
@@ -44,7 +44,19 @@ |
namespace v8 { |
namespace internal { |
+// For normal operation the syntax checker is used to determine whether to |
+// use the full compiler for top level code or not. However if the flag |
+// --always-full-compiler is specified or debugging is active the full |
+// compiler will be used for all code. |
+static bool AlwaysFullCompiler() { |
+#ifdef ENABLE_DEBUGGER_SUPPORT |
+ return FLAG_always_full_compiler || Debugger::IsDebuggerActive(); |
+#else |
+ return FLAG_always_full_compiler; |
+#endif |
+} |
+ |
static Handle<Code> MakeCode(Handle<Context> context, CompilationInfo* info) { |
FunctionLiteral* function = info->function(); |
ASSERT(function != NULL); |
@@ -120,21 +132,9 @@ |
? info->scope()->is_global_scope() |
: (shared->is_toplevel() || shared->try_full_codegen()); |
- bool force_full_compiler = false; |
-#if defined(V8_TARGET_ARCH_IA32) || defined(V8_TARGET_ARCH_X64) |
- // On ia32 the full compiler can compile all code whereas the other platforms |
- // the constructs supported is checked by the associated syntax checker. When |
- // --always-full-compiler is used on ia32 the syntax checker is still in |
- // effect, but there is a special flag --force-full-compiler to ignore the |
- // syntax checker completely and use the full compiler for all code. Also |
- // when debugging on ia32 the full compiler will be used for all code. |
- force_full_compiler = |
- Debugger::IsDebuggerActive() || FLAG_force_full_compiler; |
-#endif |
- |
- if (force_full_compiler) { |
+ if (AlwaysFullCompiler()) { |
return FullCodeGenerator::MakeCode(info); |
- } else if (FLAG_always_full_compiler || (FLAG_full_compiler && is_run_once)) { |
+ } else if (FLAG_full_compiler && is_run_once) { |
FullCodeGenSyntaxChecker checker; |
checker.Check(function); |
if (checker.has_supported_syntax()) { |
@@ -521,7 +521,11 @@ |
CHECK(!FLAG_always_full_compiler || !FLAG_always_fast_compiler); |
bool is_run_once = literal->try_full_codegen(); |
bool is_compiled = false; |
- if (FLAG_always_full_compiler || (FLAG_full_compiler && is_run_once)) { |
+ |
+ if (AlwaysFullCompiler()) { |
+ code = FullCodeGenerator::MakeCode(&info); |
+ is_compiled = true; |
+ } else if (FLAG_full_compiler && is_run_once) { |
FullCodeGenSyntaxChecker checker; |
checker.Check(literal); |
if (checker.has_supported_syntax()) { |