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

Unified Diff: src/parsing/parser.cc

Issue 2406803003: Get rid of ParseInfo::lazy (Closed)
Patch Set: restore dcheck 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/parsing/parse-info.cc ('k') | test/cctest/asmjs/test-asm-typer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index 6b21a6fe50009f62dc674e1f3b98af87d6bb44d7..53ca99f362e321e8c2a2583351f7c57a7fe8c78a 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -3826,13 +3826,9 @@ bool Parser::Parse(ParseInfo* info) {
Isolate* isolate = info->isolate();
pre_parse_timer_ = isolate->counters()->pre_parse();
- if (info->is_lazy()) {
+ if (!info->shared_info().is_null() && info->shared_info()->is_function()) {
DCHECK(!info->is_eval());
- if (info->shared_info()->is_function()) {
- result = ParseLazy(isolate, info);
- } else {
- result = ParseProgram(isolate, info);
- }
+ result = ParseLazy(isolate, info);
} else {
SetCachedData(info);
result = ParseProgram(isolate, info);
@@ -3874,12 +3870,12 @@ void Parser::ParseOnBackground(ParseInfo* info) {
// don't). We work around this by storing all the scopes which need their end
// position set at the end of the script (the top scope and possible eval
// scopes) and set their end position after we know the script length.
- if (info->is_lazy()) {
- result = DoParseLazy(info, info->function_name(), stream_ptr);
- } else {
+ if (info->is_toplevel()) {
fni_ = new (zone()) FuncNameInferrer(ast_value_factory(), zone());
scanner_.Initialize(stream_ptr);
result = DoParseProgram(info);
+ } else {
+ result = DoParseLazy(info, info->function_name(), stream_ptr);
}
info->set_literal(result);
« no previous file with comments | « src/parsing/parse-info.cc ('k') | test/cctest/asmjs/test-asm-typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698