Reviewers: Lasse Reichstein,

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


Please review this at http://codereview.chromium.org/449012

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
   M     src/compiler.cc
   M     src/flag-definitions.h


Index: src/flag-definitions.h
===================================================================
--- src/flag-definitions.h      (revision 3376)
+++ src/flag-definitions.h      (working copy)
@@ -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")
Index: src/compiler.cc
===================================================================
--- src/compiler.cc     (revision 3376)
+++ src/compiler.cc     (working copy)
@@ -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;


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

Reply via email to