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

Unified Diff: src/parsing/parser.cc

Issue 2342133003: Don't force eager parsing when natives are allowed. (Closed)
Patch Set: cleaner Created 4 years, 3 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 | « no previous file | no next file » | 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 7e4086283f91e0873a92d1a21e2762f2c7bf4858..e55f033d0bd2993bbe1519143fd69647b67670f3 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -638,7 +638,8 @@ Parser::Parser(ParseInfo* info)
// ParseInfo during background parsing.
DCHECK(!info->script().is_null() || info->source_stream() != nullptr ||
info->character_stream() != nullptr);
- set_allow_lazy(info->allow_lazy_parsing());
+ set_allow_lazy(FLAG_lazy && info->allow_lazy_parsing() &&
+ !info->is_native() && info->extension() == nullptr);
set_allow_natives(FLAG_allow_natives_syntax || info->is_native());
set_allow_tailcalls(FLAG_harmony_tailcalls && !info->is_native() &&
info->isolate()->is_tail_call_elimination_enabled());
@@ -753,8 +754,7 @@ FunctionLiteral* Parser::DoParseProgram(ParseInfo* info) {
DCHECK_NULL(scope_state_);
DCHECK_NULL(target_stack_);
- Mode parsing_mode = FLAG_lazy && allow_lazy() ? PARSE_LAZILY : PARSE_EAGERLY;
- if (allow_natives() || extension_ != NULL) parsing_mode = PARSE_EAGERLY;
+ Mode parsing_mode = allow_lazy() ? PARSE_LAZILY : PARSE_EAGERLY;
FunctionLiteral* result = NULL;
{
@@ -2936,8 +2936,7 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
// - For asm.js functions the body needs to be available when module
// validation is active, because we examine the entire module at once.
bool use_temp_zone =
- !is_lazily_parsed && FLAG_lazy && !allow_natives() &&
- extension_ == NULL && allow_lazy() &&
+ !is_lazily_parsed && allow_lazy() &&
function_type == FunctionLiteral::kDeclaration &&
eager_compile_hint != FunctionLiteral::kShouldEagerCompile &&
!(FLAG_validate_asm && scope()->IsAsmModule());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698