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

Unified Diff: src/parsing/parser.cc

Issue 1932213002: Version 5.1.281.23 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@5.1
Patch Set: Created 4 years, 8 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/parser.h ('k') | src/parsing/parser-base.h » ('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 69cea62d827034bcd931b4661e13afdccda12db5..717b3f6491fa3cf1b44d050e75b11debf0df30d5 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -764,6 +764,9 @@ ClassLiteral* ParserTraits::ParseClassLiteral(
name_is_strict_reserved, pos, ok);
}
+void ParserTraits::MarkTailPosition(Expression* expression) {
+ expression->MarkTail();
+}
Parser::Parser(ParseInfo* info)
: ParserBase<ParserTraits>(info->zone(), &scanner_, info->stack_limit(),
@@ -3594,6 +3597,8 @@ Statement* Parser::ParseForStatement(ZoneList<const AstRawString*>* labels,
factory()->NewBlock(NULL, 3, false, RelocInfo::kNoPosition);
{
+ DontCollectExpressionsInTailPositionScope no_tail_calls(
+ function_state_);
BlockState block_state(&scope_, body_scope);
Statement* body = ParseScopedStatement(NULL, true, CHECK_OK);
@@ -4650,7 +4655,7 @@ ZoneList<Statement*>* Parser::ParseEagerFunctionBody(
const List<Expression*>& expressions_in_tail_position =
function_state_->expressions_in_tail_position();
for (int i = 0; i < expressions_in_tail_position.length(); ++i) {
- expressions_in_tail_position[i]->MarkTail();
+ MarkTailPosition(expressions_in_tail_position[i]);
}
return result;
}
« no previous file with comments | « src/parsing/parser.h ('k') | src/parsing/parser-base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698