Index: src/parsing/parser.cc |
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc |
index 53d18fb3e9b9304d1def1dfcd04806924f298231..f0870e5af6eb31c700d0c714b3e2090e6aa93d0b 100644 |
--- a/src/parsing/parser.cc |
+++ b/src/parsing/parser.cc |
@@ -3993,11 +3993,10 @@ FunctionLiteral* Parser::ParseFunctionLiteral( |
int materialized_literal_count = -1; |
int expected_property_count = -1; |
DuplicateFinder duplicate_finder(scanner()->unicode_cache()); |
- FunctionLiteral::EagerCompileHint eager_compile_hint = |
- parenthesized_function_ ? FunctionLiteral::kShouldEagerCompile |
- : FunctionLiteral::kShouldLazyCompile; |
bool should_be_used_once_hint = false; |
bool has_duplicate_parameters; |
+ FunctionLiteral::EagerCompileHint eager_compile_hint; |
+ |
// Parse function. |
{ |
AstNodeFactory function_factory(ast_value_factory()); |
@@ -4006,6 +4005,10 @@ FunctionLiteral* Parser::ParseFunctionLiteral( |
scope_->SetScopeName(function_name); |
ExpressionClassifier formals_classifier(this, &duplicate_finder); |
+ eager_compile_hint = function_state_->this_function_is_parenthesized() |
+ ? FunctionLiteral::kShouldEagerCompile |
+ : FunctionLiteral::kShouldLazyCompile; |
+ |
if (is_generator) { |
// For generators, allocating variables in contexts is currently a win |
// because it minimizes the work needed to suspend and resume an |
@@ -4074,8 +4077,7 @@ FunctionLiteral* Parser::ParseFunctionLiteral( |
// logic where only top-level functions will be parsed lazily. |
bool is_lazily_parsed = mode() == PARSE_LAZILY && |
scope_->AllowsLazyParsing() && |
- !parenthesized_function_; |
- parenthesized_function_ = false; // The bit was set for this function only. |
+ !function_state_->this_function_is_parenthesized(); |
// Eager or lazy parse? |
// If is_lazily_parsed, we'll parse lazy. If we can set a bookmark, we'll |