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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3381 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent bb69a555
......@@ -124,9 +124,12 @@ static Handle<Code> MakeCode(FunctionLiteral* literal,
// 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;
......
......@@ -147,6 +147,8 @@ DEFINE_bool(fast_compiler, true,
"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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment