Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: src/compiler.cc

Issue 2417643004: Explicitly check for lazy parser when dealing with parser cache (Closed)
Patch Set: Reset compile options to kNoCompileOptions if the cache is invalid Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/background-parsing-task.cc ('k') | src/parsing/parse-info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index eb2e1839af4a93ee62a5c339b443307f352e3132..a6a600cf7bfef0edded71c736f06b7416cd7701c 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -1036,30 +1036,8 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
Handle<SharedFunctionInfo> result;
{ VMState<COMPILER> state(info->isolate());
- if (parse_info->literal() == NULL) {
- // Parse the script if needed (if it's already parsed, literal() is
- // non-NULL). If compiling for debugging, we may eagerly compile inner
- // functions, so do not parse lazily in that case.
- ScriptCompiler::CompileOptions options = parse_info->compile_options();
- bool parse_allow_lazy =
- options == ScriptCompiler::kConsumeParserCache ||
- String::cast(script->source())->length() > FLAG_min_preparse_length;
-
- parse_info->set_allow_lazy_parsing(parse_allow_lazy);
- if (!parse_allow_lazy &&
- (options == ScriptCompiler::kProduceParserCache ||
- options == ScriptCompiler::kConsumeParserCache)) {
- // 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.
- // Eager parsing cannot benefit from cached data, and producing cached
- // data while parsing eagerly is not implemented.
- parse_info->set_cached_data(nullptr);
- parse_info->set_compile_options(ScriptCompiler::kNoCompileOptions);
- }
-
- if (!Parse(parse_info)) {
- return Handle<SharedFunctionInfo>::null();
- }
+ if (parse_info->literal() == nullptr && !Parse(parse_info)) {
+ return Handle<SharedFunctionInfo>::null();
}
FunctionLiteral* lit = parse_info->literal();
« no previous file with comments | « src/background-parsing-task.cc ('k') | src/parsing/parse-info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698