Commit f37d7264 authored by marja's avatar marja Committed by Commit bot

PreParsing inner functions: Make inner functions less lazy.

Especially, make non-declaration type inner functions eagerly
parsed. Then we still have a chance to compile them eagerly if we see ()
after the function.

BUG=v8:5501

Review-Url: https://codereview.chromium.org/2583843002
Cr-Commit-Position: refs/heads/master@{#41762}
parent d2d6da03
......@@ -855,6 +855,9 @@ DEFINE_BOOL(allow_natives_syntax, false, "allow natives syntax")
DEFINE_BOOL(trace_parse, false, "trace parsing and preparsing")
DEFINE_BOOL(trace_preparse, false, "trace preparsing decisions")
DEFINE_BOOL(lazy_inner_functions, true, "enable lazy parsing inner functions")
DEFINE_BOOL(aggressive_lazy_inner_functions, false,
"even lazier inner function parsing")
DEFINE_IMPLICATION(aggressive_lazy_inner_functions, lazy_inner_functions)
// simulator-arm.cc, simulator-arm64.cc and simulator-mips.cc
DEFINE_BOOL(trace_sim, false, "Trace simulator execution")
......
......@@ -2612,11 +2612,18 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
// will migrate unresolved variable into a Scope in the main Zone.
// TODO(marja): Refactor parsing modes: simplify this.
bool use_temp_zone =
(FLAG_lazy_inner_functions
(FLAG_aggressive_lazy_inner_functions
? can_preparse
: (is_lazy_top_level_function ||
(allow_lazy_ && function_type == FunctionLiteral::kDeclaration &&
(parse_lazily() &&
function_type == FunctionLiteral::kDeclaration &&
eager_compile_hint == FunctionLiteral::kShouldLazyCompile)));
DCHECK_IMPLIES(
(is_lazy_top_level_function ||
(parse_lazily() && function_type == FunctionLiteral::kDeclaration &&
eager_compile_hint == FunctionLiteral::kShouldLazyCompile)),
can_preparse);
bool is_lazy_inner_function =
use_temp_zone && FLAG_lazy_inner_functions && !is_lazy_top_level_function;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment