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

Side by Side Diff: src/parsing/pattern-rewriter.cc

Issue 2274113002: [parser] Clean up (pre)parser traits, part 4 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « src/parsing/parser-base.h ('k') | src/parsing/preparser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/ast/ast.h" 5 #include "src/ast/ast.h"
6 #include "src/messages.h" 6 #include "src/messages.h"
7 #include "src/parsing/parameter-initializer-rewriter.h" 7 #include "src/parsing/parameter-initializer-rewriter.h"
8 #include "src/parsing/parser.h" 8 #include "src/parsing/parser.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 VisitObjectLiteral(node, &temp_var); 367 VisitObjectLiteral(node, &temp_var);
368 } 368 }
369 369
370 370
371 void Parser::PatternRewriter::VisitArrayLiteral(ArrayLiteral* node, 371 void Parser::PatternRewriter::VisitArrayLiteral(ArrayLiteral* node,
372 Variable** temp_var) { 372 Variable** temp_var) {
373 DCHECK(block_->ignore_completion_value()); 373 DCHECK(block_->ignore_completion_value());
374 374
375 auto temp = *temp_var = CreateTempVar(current_value_); 375 auto temp = *temp_var = CreateTempVar(current_value_);
376 auto iterator = CreateTempVar(parser_->GetIterator( 376 auto iterator = CreateTempVar(parser_->GetIterator(
377 factory()->NewVariableProxy(temp), factory(), kNoSourcePosition)); 377 factory()->NewVariableProxy(temp), kNoSourcePosition));
378 auto done = 378 auto done =
379 CreateTempVar(factory()->NewBooleanLiteral(false, kNoSourcePosition)); 379 CreateTempVar(factory()->NewBooleanLiteral(false, kNoSourcePosition));
380 auto result = CreateTempVar(); 380 auto result = CreateTempVar();
381 auto v = CreateTempVar(); 381 auto v = CreateTempVar();
382 auto completion = CreateTempVar(); 382 auto completion = CreateTempVar();
383 auto nopos = kNoSourcePosition; 383 auto nopos = kNoSourcePosition;
384 384
385 // For the purpose of iterator finalization, we temporarily set block_ to a 385 // For the purpose of iterator finalization, we temporarily set block_ to a
386 // new block. In the main body of this function, we write to block_ (both 386 // new block. In the main body of this function, we write to block_ (both
387 // explicitly and implicitly via recursion). At the end of the function, we 387 // explicitly and implicitly via recursion). At the end of the function, we
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 NOT_A_PATTERN(TryFinallyStatement) 702 NOT_A_PATTERN(TryFinallyStatement)
703 NOT_A_PATTERN(UnaryOperation) 703 NOT_A_PATTERN(UnaryOperation)
704 NOT_A_PATTERN(VariableDeclaration) 704 NOT_A_PATTERN(VariableDeclaration)
705 NOT_A_PATTERN(WhileStatement) 705 NOT_A_PATTERN(WhileStatement)
706 NOT_A_PATTERN(WithStatement) 706 NOT_A_PATTERN(WithStatement)
707 NOT_A_PATTERN(Yield) 707 NOT_A_PATTERN(Yield)
708 708
709 #undef NOT_A_PATTERN 709 #undef NOT_A_PATTERN
710 } // namespace internal 710 } // namespace internal
711 } // namespace v8 711 } // namespace v8
OLDNEW
« no previous file with comments | « src/parsing/parser-base.h ('k') | src/parsing/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698