| Index: src/compiler.cc
|
| diff --git a/src/compiler.cc b/src/compiler.cc
|
| index 21f107a7750af0daadf95ccd4465002f77d20406..bb6ce2bdca828b02ea95f918ce9d57912503f1c8 100644
|
| --- a/src/compiler.cc
|
| +++ b/src/compiler.cc
|
| @@ -115,7 +115,7 @@ void CompilationInfo::Initialize(Isolate* isolate,
|
| scope_ = NULL;
|
| global_scope_ = NULL;
|
| extension_ = NULL;
|
| - pre_parse_data_ = NULL;
|
| + cached_data_ = NULL;
|
| zone_ = zone;
|
| deferred_handles_ = NULL;
|
| code_stub_ = NULL;
|
| @@ -807,15 +807,18 @@ static Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
|
| ASSERT(info->is_eval() || info->is_global());
|
|
|
| bool parse_allow_lazy =
|
| - (info->pre_parse_data() != NULL ||
|
| + (info->cached_data() != NULL ||
|
| 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);
|
| + if (!parse_allow_lazy && info->cached_data() != NULL) {
|
| + // We are going to parse eagerly, but we either 1) have cached data produced
|
| + // by lazy parsing or 2) are asked to generate cached data. We cannot use
|
| + // the existing data, since it won't contain all the symbols we need for
|
| + // eager parsing. In addition, it doesn't make sense to generate the data
|
| + // when parsing eagerly. That data would contain all symbols, but no
|
| + // functions, so it couldn't be used to aid lazy parsing later.
|
| + info->SetCachedData(NULL);
|
| }
|
|
|
| Handle<SharedFunctionInfo> result;
|
| @@ -943,7 +946,7 @@ Handle<SharedFunctionInfo> Compiler::CompileScript(Handle<String> source,
|
| bool is_shared_cross_origin,
|
| Handle<Context> context,
|
| v8::Extension* extension,
|
| - ScriptDataImpl* pre_data,
|
| + ScriptDataImpl** cached_data,
|
| NativesFlag natives) {
|
| Isolate* isolate = source->GetIsolate();
|
| int source_length = source->length();
|
| @@ -989,7 +992,7 @@ Handle<SharedFunctionInfo> Compiler::CompileScript(Handle<String> source,
|
| CompilationInfoWithZone info(script);
|
| info.MarkAsGlobal();
|
| info.SetExtension(extension);
|
| - info.SetPreParseData(pre_data);
|
| + info.SetCachedData(cached_data);
|
| info.SetContext(context);
|
| if (FLAG_use_strict) info.SetStrictMode(STRICT);
|
| result = CompileToplevel(&info);
|
|
|