From 87e7fc94fe1abf51d4d0d03893eb3bb3c06e2b4f Mon Sep 17 00:00:00 2001 From: Adam Klein Date: Tue, 21 Nov 2017 17:44:04 -0800 Subject: [PATCH] [parser cleanup] Remove a few impl() calls, replace a CHECK with DCHECK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: v8:6092 Change-Id: I518516d3600458faba5ace1eee1e5b5c3cc560ce Reviewed-on: https://chromium-review.googlesource.com/784127 Reviewed-by: Marja Hölttä Commit-Queue: Adam Klein Cr-Commit-Position: refs/heads/master@{#49645} --- src/parsing/parser-base.h | 6 +++--- src/parsing/parser.cc | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h index b78a570cdd..3105699e11 100644 --- a/src/parsing/parser-base.h +++ b/src/parsing/parser-base.h @@ -4624,7 +4624,7 @@ typename ParserBase::ExpressionT ParserBase::ParseTemplateLiteral( // // When parsing a TemplateLiteral, we must have scanned either an initial // TEMPLATE_SPAN, or a TEMPLATE_TAIL. - CHECK(peek() == Token::TEMPLATE_SPAN || peek() == Token::TEMPLATE_TAIL); + DCHECK(peek() == Token::TEMPLATE_SPAN || peek() == Token::TEMPLATE_TAIL); bool forbid_illegal_escapes = !allow_harmony_template_escapes() || !tagged; @@ -5832,7 +5832,7 @@ ParserBase::ParseForEachStatementWithoutDeclarations( ForInfo* for_info, ZoneList* labels, bool* ok) { // Initializer is reference followed by in/of. if (!expression->IsArrayLiteral() && !expression->IsObjectLiteral()) { - expression = impl()->CheckAndRewriteReferenceExpression( + expression = CheckAndRewriteReferenceExpression( expression, lhs_beg_pos, lhs_end_pos, MessageTemplate::kInvalidLhsInFor, kSyntaxError, CHECK_OK); } @@ -6033,7 +6033,7 @@ typename ParserBase::StatementT ParserBase::ParseForAwaitStatement( ValidateAssignmentPattern(CHECK_OK); } else { impl()->RewriteNonPattern(CHECK_OK); - each_variable = impl()->CheckAndRewriteReferenceExpression( + each_variable = CheckAndRewriteReferenceExpression( lhs, lhs_beg_pos, lhs_end_pos, MessageTemplate::kInvalidLhsInFor, kSyntaxError, CHECK_OK); } diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc index 83b70e79d6..6e3d790122 100644 --- a/src/parsing/parser.cc +++ b/src/parsing/parser.cc @@ -2590,8 +2590,7 @@ FunctionLiteral* Parser::ParseFunctionLiteral( const bool is_lazy = eager_compile_hint == FunctionLiteral::kShouldLazyCompile; - const bool is_top_level = - impl()->AllowsLazyParsingWithoutUnresolvedVariables(); + const bool is_top_level = AllowsLazyParsingWithoutUnresolvedVariables(); const bool is_lazy_top_level_function = is_lazy && is_top_level; const bool is_lazy_inner_function = is_lazy && !is_top_level; const bool is_expression =