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

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

Issue 2557593004: [ignition] desugar GetIterator() via bytecode rather than via AST (Closed)
Patch Set: georg's comments Created 4 years 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.cc ('k') | src/runtime/runtime.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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 Variable* temp_var = nullptr; 352 Variable* temp_var = nullptr;
353 VisitObjectLiteral(node, &temp_var); 353 VisitObjectLiteral(node, &temp_var);
354 } 354 }
355 355
356 356
357 void Parser::PatternRewriter::VisitArrayLiteral(ArrayLiteral* node, 357 void Parser::PatternRewriter::VisitArrayLiteral(ArrayLiteral* node,
358 Variable** temp_var) { 358 Variable** temp_var) {
359 DCHECK(block_->ignore_completion_value()); 359 DCHECK(block_->ignore_completion_value());
360 360
361 auto temp = *temp_var = CreateTempVar(current_value_); 361 auto temp = *temp_var = CreateTempVar(current_value_);
362 auto iterator = CreateTempVar(parser_->GetIterator( 362 auto iterator = CreateTempVar(factory()->NewGetIterator(
363 factory()->NewVariableProxy(temp), kNoSourcePosition)); 363 factory()->NewVariableProxy(temp), kNoSourcePosition));
364 auto done = 364 auto done =
365 CreateTempVar(factory()->NewBooleanLiteral(false, kNoSourcePosition)); 365 CreateTempVar(factory()->NewBooleanLiteral(false, kNoSourcePosition));
366 auto result = CreateTempVar(); 366 auto result = CreateTempVar();
367 auto v = CreateTempVar(); 367 auto v = CreateTempVar();
368 auto completion = CreateTempVar(); 368 auto completion = CreateTempVar();
369 auto nopos = kNoSourcePosition; 369 auto nopos = kNoSourcePosition;
370 370
371 // For the purpose of iterator finalization, we temporarily set block_ to a 371 // For the purpose of iterator finalization, we temporarily set block_ to a
372 // new block. In the main body of this function, we write to block_ (both 372 // new block. In the main body of this function, we write to block_ (both
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 NOT_A_PATTERN(DoExpression) 666 NOT_A_PATTERN(DoExpression)
667 NOT_A_PATTERN(DoWhileStatement) 667 NOT_A_PATTERN(DoWhileStatement)
668 NOT_A_PATTERN(EmptyStatement) 668 NOT_A_PATTERN(EmptyStatement)
669 NOT_A_PATTERN(EmptyParentheses) 669 NOT_A_PATTERN(EmptyParentheses)
670 NOT_A_PATTERN(ExpressionStatement) 670 NOT_A_PATTERN(ExpressionStatement)
671 NOT_A_PATTERN(ForInStatement) 671 NOT_A_PATTERN(ForInStatement)
672 NOT_A_PATTERN(ForOfStatement) 672 NOT_A_PATTERN(ForOfStatement)
673 NOT_A_PATTERN(ForStatement) 673 NOT_A_PATTERN(ForStatement)
674 NOT_A_PATTERN(FunctionDeclaration) 674 NOT_A_PATTERN(FunctionDeclaration)
675 NOT_A_PATTERN(FunctionLiteral) 675 NOT_A_PATTERN(FunctionLiteral)
676 NOT_A_PATTERN(GetIterator)
676 NOT_A_PATTERN(IfStatement) 677 NOT_A_PATTERN(IfStatement)
677 NOT_A_PATTERN(Literal) 678 NOT_A_PATTERN(Literal)
678 NOT_A_PATTERN(NativeFunctionLiteral) 679 NOT_A_PATTERN(NativeFunctionLiteral)
679 NOT_A_PATTERN(RegExpLiteral) 680 NOT_A_PATTERN(RegExpLiteral)
680 NOT_A_PATTERN(ReturnStatement) 681 NOT_A_PATTERN(ReturnStatement)
681 NOT_A_PATTERN(SloppyBlockFunctionStatement) 682 NOT_A_PATTERN(SloppyBlockFunctionStatement)
682 NOT_A_PATTERN(Spread) 683 NOT_A_PATTERN(Spread)
683 NOT_A_PATTERN(SuperPropertyReference) 684 NOT_A_PATTERN(SuperPropertyReference)
684 NOT_A_PATTERN(SuperCallReference) 685 NOT_A_PATTERN(SuperCallReference)
685 NOT_A_PATTERN(SwitchStatement) 686 NOT_A_PATTERN(SwitchStatement)
686 NOT_A_PATTERN(ThisFunction) 687 NOT_A_PATTERN(ThisFunction)
687 NOT_A_PATTERN(Throw) 688 NOT_A_PATTERN(Throw)
688 NOT_A_PATTERN(TryCatchStatement) 689 NOT_A_PATTERN(TryCatchStatement)
689 NOT_A_PATTERN(TryFinallyStatement) 690 NOT_A_PATTERN(TryFinallyStatement)
690 NOT_A_PATTERN(UnaryOperation) 691 NOT_A_PATTERN(UnaryOperation)
691 NOT_A_PATTERN(VariableDeclaration) 692 NOT_A_PATTERN(VariableDeclaration)
692 NOT_A_PATTERN(WhileStatement) 693 NOT_A_PATTERN(WhileStatement)
693 NOT_A_PATTERN(WithStatement) 694 NOT_A_PATTERN(WithStatement)
694 NOT_A_PATTERN(Yield) 695 NOT_A_PATTERN(Yield)
695 696
696 #undef NOT_A_PATTERN 697 #undef NOT_A_PATTERN
697 } // namespace internal 698 } // namespace internal
698 } // namespace v8 699 } // namespace v8
OLDNEW
« no previous file with comments | « src/parsing/parser.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698