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

Unified Diff: src/parser.cc

Issue 1354523003: Fix temp_zone scoping when parsing inner function literals (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | « src/ast.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 6f51d82e643d3e94625bc0505255f173c05efdac..32736688287addff1ff9c0f68badf8c3db88d14f 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -4224,7 +4224,7 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
// FunctionExpression; even without enclosing parentheses it might be
// immediately invoked.
// - The function literal shouldn't be hinted to eagerly compile.
- bool can_use_temp_zone =
+ bool use_temp_zone =
FLAG_lazy && !allow_natives() && extension_ == NULL && allow_lazy() &&
function_type == FunctionLiteral::DECLARATION &&
eager_compile_hint != FunctionLiteral::kShouldEagerCompile;
@@ -4237,14 +4237,14 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
// parser-persistent zone (see parser_zone_ in AstNodeFactory).
{
Zone temp_zone;
- AstNodeFactory::BodyScope(factory(), &temp_zone, can_use_temp_zone);
+ AstNodeFactory::BodyScope inner(factory(), &temp_zone, use_temp_zone);
body = ParseEagerFunctionBody(function_name, pos, formals, kind,
function_type, CHECK_OK);
}
materialized_literal_count = function_state.materialized_literal_count();
expected_property_count = function_state.expected_property_count();
- if (can_use_temp_zone) {
+ if (use_temp_zone) {
// If the preconditions are correct the function body should never be
// accessed, but do this anyway for better behaviour if they're wrong.
body = NULL;
« no previous file with comments | « src/ast.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698