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

Side by Side Diff: src/parsing/parser.cc

Issue 2006613002: [turbofan] Lower intrinsics %_GeneratorGetInput and %_GeneratorGetResumeMode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/parsing/parser.h" 5 #include "src/parsing/parser.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/ast/ast-expression-rewriter.h" 9 #include "src/ast/ast-expression-rewriter.h"
10 #include "src/ast/ast-expression-visitor.h" 10 #include "src/ast/ast-expression-visitor.h"
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 factory, parser_->ast_value_factory()->new_target_string(), 662 factory, parser_->ast_value_factory()->new_target_string(),
663 Variable::NORMAL, pos, pos + kNewTargetStringLength); 663 Variable::NORMAL, pos, pos + kNewTargetStringLength);
664 proxy->set_is_new_target(); 664 proxy->set_is_new_target();
665 return proxy; 665 return proxy;
666 } 666 }
667 667
668 668
669 Expression* ParserTraits::FunctionSentExpression(Scope* scope, 669 Expression* ParserTraits::FunctionSentExpression(Scope* scope,
670 AstNodeFactory* factory, 670 AstNodeFactory* factory,
671 int pos) { 671 int pos) {
672 // We desugar function.sent into %GeneratorGetInput(generator). 672 // We desugar function.sent into %_GeneratorGetInput(generator).
673 Zone* zone = parser_->zone(); 673 Zone* zone = parser_->zone();
674 ZoneList<Expression*>* args = new (zone) ZoneList<Expression*>(1, zone); 674 ZoneList<Expression*>* args = new (zone) ZoneList<Expression*>(1, zone);
675 VariableProxy* generator = factory->NewVariableProxy( 675 VariableProxy* generator = factory->NewVariableProxy(
676 parser_->function_state_->generator_object_variable()); 676 parser_->function_state_->generator_object_variable());
677 args->Add(generator, zone); 677 args->Add(generator, zone);
678 return factory->NewCallRuntime(Runtime::kGeneratorGetInput, args, pos); 678 return factory->NewCallRuntime(Runtime::kInlineGeneratorGetInput, args, pos);
679 } 679 }
680 680
681 681
682 Literal* ParserTraits::ExpressionFromLiteral(Token::Value token, int pos, 682 Literal* ParserTraits::ExpressionFromLiteral(Token::Value token, int pos,
683 Scanner* scanner, 683 Scanner* scanner,
684 AstNodeFactory* factory) { 684 AstNodeFactory* factory) {
685 switch (token) { 685 switch (token) {
686 case Token::NULL_LITERAL: 686 case Token::NULL_LITERAL:
687 return factory->NewNullLiteral(pos); 687 return factory->NewNullLiteral(pos);
688 case Token::TRUE_LITERAL: 688 case Token::TRUE_LITERAL:
(...skipping 6223 matching lines...) Expand 10 before | Expand all | Expand 10 after
6912 try_block, target); 6912 try_block, target);
6913 final_loop = target; 6913 final_loop = target;
6914 } 6914 }
6915 6915
6916 return final_loop; 6916 return final_loop;
6917 } 6917 }
6918 6918
6919 6919
6920 } // namespace internal 6920 } // namespace internal
6921 } // namespace v8 6921 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | test/cctest/interpreter/bytecode_expectations/Generators.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698