Reviewers: ulan,

Message:
ulan, ptal

Description:
Lazy preparsing vs. lazy parsing fix.

Preparsing is always maximally lazy (every function that can be lazy is
preparsed
lazily), but Parser has more complicated laziness logic.

If we're going to parse eagerly, and we have preparse data from lazy preparsing, we're gonna have a bad time. The symbol stream won't contain symbols inside lazy functions, and when the Parser parses them eagerly, it will consume symbols from
the symbol stream, and everything will go wrong.

[email protected]
BUG=346207

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

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

Affected files (+7, -0 lines):
  M src/compiler.cc


Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index d466778069b19f22b58008507702e0d6fadc3e0a..743d3336881a760894a6fabfe0a0855d86508b93 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -789,6 +789,13 @@ static Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) { String::cast(script->source())->length() > FLAG_min_preparse_length) &&
       !DebuggerWantsEagerCompilation(info);

+  if (!parse_allow_lazy && info->pre_parse_data() != NULL) {
+ // We are going to parse eagerly, but we have preparse data produced by lazy + // preparsing. We cannot use it, since it won't contain all the symbols we
+    // need for eager parsing.
+    info->SetPreParseData(NULL);
+  }
+
   Handle<SharedFunctionInfo> result;

   { VMState<COMPILER> state(info->isolate());


--
--
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/groups/opt_out.

Reply via email to