Reviewers: marja (ooo until 13th Oct),

Description:
--no-lazy flag applies also to top-level scripts

The --lazy flag, currently unused within V8 and its test suites,
controls whether top-level functions may be lazily parsed.  This commit
expands it to also apply to toplevel scripts, which were controllable
previously only via the --min_preparse_length flag.

[email protected]
BUG=

Please review this at https://codereview.chromium.org/649623002/

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

Affected files (+5, -4 lines):
  M src/compiler.cc


Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index ce3badb0f380727a0eef5c5f57412e2bce9c0097..f580705c7c0e95ba9eaa3fc4ec502b0469abb0e1 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -1010,10 +1010,11 @@ static Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
       // Parse the script if needed (if it's already parsed, function() is
       // non-NULL).
       bool parse_allow_lazy =
- (info->compile_options() == ScriptCompiler::kConsumeParserCache | |
-           String::cast(script->source())->length() >
-               FLAG_min_preparse_length) &&
-          !Compiler::DebuggerWantsEagerCompilation(info);
+          (FLAG_lazy &&
+ (info->compile_options() == ScriptCompiler::kConsumeParserCache ||
+            String::cast(script->source())->length() >
+                FLAG_min_preparse_length) &&
+           !Compiler::DebuggerWantsEagerCompilation(info));

       if (!parse_allow_lazy &&
(info->compile_options() == ScriptCompiler::kProduceParserCache | |


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to