Index: src/compiler.cc |
diff --git a/src/compiler.cc b/src/compiler.cc |
index 6f9b901d9f8909e713c2c31ffe070e808fd2ff4e..de8cb7bd810cff20d6066b919397760221673176 100644 |
--- a/src/compiler.cc |
+++ b/src/compiler.cc |
@@ -520,14 +520,15 @@ static Handle<SharedFunctionInfo> MakeFunctionInfo(CompilationInfo* info) { |
// Only allow non-global compiles for eval. |
ASSERT(info->is_eval() || info->is_global()); |
- ParsingFlags flags = kNoParsingFlags; |
- if ((info->pre_parse_data() != NULL || |
- String::cast(script->source())->length() > FLAG_min_preparse_length) && |
- !DebuggerWantsEagerCompilation(info)) { |
- flags = kAllowLazy; |
- } |
- if (!ParserApi::Parse(info, flags)) { |
- return Handle<SharedFunctionInfo>::null(); |
+ { |
+ Parser parser(info); |
+ if ((info->pre_parse_data() != NULL || |
+ String::cast(script->source())->length() > FLAG_min_preparse_length) && |
+ !DebuggerWantsEagerCompilation(info)) |
+ parser.set_allow_lazy(true); |
+ if (!parser.Parse()) { |
+ return Handle<SharedFunctionInfo>::null(); |
+ } |
} |
// Measure how long it takes to do the compilation; only take the |
@@ -864,7 +865,7 @@ bool Compiler::CompileLazy(CompilationInfo* info) { |
if (InstallCodeFromOptimizedCodeMap(info)) return true; |
// Generate the AST for the lazily compiled function. |
- if (ParserApi::Parse(info, kNoParsingFlags)) { |
+ if (Parser::Parse(info)) { |
// Measure how long it takes to do the lazy compilation; only take the |
// rest of the function into account to avoid overlap with the lazy |
// parsing statistics. |
@@ -932,7 +933,7 @@ void Compiler::RecompileParallel(Handle<JSFunction> closure) { |
return; |
} |
- if (ParserApi::Parse(*info, kNoParsingFlags)) { |
+ if (Parser::Parse(*info)) { |
LanguageMode language_mode = info->function()->language_mode(); |
info->SetLanguageMode(language_mode); |
shared->set_language_mode(language_mode); |