Revision: 3381
Author: [email protected]
Date: Mon Nov 30 05:35:59 2009
Log: Introduce flag for using the fast compiler where possible.

We use the fast compiler only for top-level code right now.
When always_fast_compiler is set to true, we compile with
the fast compiler whereever possible.

By default this flag is set to false.

Review URL: http://codereview.chromium.org/449012
http://code.google.com/p/v8/source/detail?r=3381

Modified:
  /branches/bleeding_edge/src/compiler.cc
  /branches/bleeding_edge/src/flag-definitions.h

=======================================
--- /branches/bleeding_edge/src/compiler.cc     Thu Nov 26 16:28:06 2009
+++ /branches/bleeding_edge/src/compiler.cc     Mon Nov 30 05:35:59 2009
@@ -124,9 +124,12 @@
      // If there is no shared function info, try the fast code
      // generator for code in the global scope.  Otherwise obey the
      // explicit hint in the shared function info.
-    if (shared.is_null() && !literal->scope()->is_global_scope()) {
+    // If always_fast_compiler is true, always try the fast compiler.
+    if (shared.is_null() && !literal->scope()->is_global_scope() &&
+        !FLAG_always_fast_compiler) {
        if (FLAG_trace_bailout) PrintF("Non-global scope\n");
-    } else if (!shared.is_null() && !shared->try_fast_codegen()) {
+    } else if (!shared.is_null() && !shared->try_fast_codegen() &&
+               !FLAG_always_fast_compiler) {
        if (FLAG_trace_bailout) PrintF("No hint to try fast\n");
      } else {
        CodeGenSelector selector;
=======================================
--- /branches/bleeding_edge/src/flag-definitions.h      Thu Nov 26 13:13:20 2009
+++ /branches/bleeding_edge/src/flag-definitions.h      Mon Nov 30 05:35:59 2009
@@ -147,6 +147,8 @@
              "use the fast-mode compiler for some top-level code")
  DEFINE_bool(trace_bailout, false,
              "print reasons for failing to use fast compilation")
+DEFINE_bool(always_fast_compiler, false,
+            "always try using the fast compiler")

  // compilation-cache.cc
  DEFINE_bool(compilation_cache, true, "enable compilation cache")

-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to