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

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

Issue 2079613003: [generators] Implement %GeneratorGetSourcePosition. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rename again, and move subtraction to runtime Created 4 years, 6 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/objects-inl.h ('k') | src/ppc/builtins-ppc.cc » ('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 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 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 factory, parser_->ast_value_factory()->new_target_string(), 673 factory, parser_->ast_value_factory()->new_target_string(),
674 Variable::NORMAL, pos, pos + kNewTargetStringLength); 674 Variable::NORMAL, pos, pos + kNewTargetStringLength);
675 proxy->set_is_new_target(); 675 proxy->set_is_new_target();
676 return proxy; 676 return proxy;
677 } 677 }
678 678
679 679
680 Expression* ParserTraits::FunctionSentExpression(Scope* scope, 680 Expression* ParserTraits::FunctionSentExpression(Scope* scope,
681 AstNodeFactory* factory, 681 AstNodeFactory* factory,
682 int pos) { 682 int pos) {
683 // We desugar function.sent into %_GeneratorGetInput(generator). 683 // We desugar function.sent into %_GeneratorGetInputOrDebugPos(generator).
684 Zone* zone = parser_->zone(); 684 Zone* zone = parser_->zone();
685 ZoneList<Expression*>* args = new (zone) ZoneList<Expression*>(1, zone); 685 ZoneList<Expression*>* args = new (zone) ZoneList<Expression*>(1, zone);
686 VariableProxy* generator = factory->NewVariableProxy( 686 VariableProxy* generator = factory->NewVariableProxy(
687 parser_->function_state_->generator_object_variable()); 687 parser_->function_state_->generator_object_variable());
688 args->Add(generator, zone); 688 args->Add(generator, zone);
689 return factory->NewCallRuntime(Runtime::kInlineGeneratorGetInput, args, pos); 689 return factory->NewCallRuntime(Runtime::kInlineGeneratorGetInputOrDebugPos,
690 args, pos);
690 } 691 }
691 692
692 693
693 Literal* ParserTraits::ExpressionFromLiteral(Token::Value token, int pos, 694 Literal* ParserTraits::ExpressionFromLiteral(Token::Value token, int pos,
694 Scanner* scanner, 695 Scanner* scanner,
695 AstNodeFactory* factory) { 696 AstNodeFactory* factory) {
696 switch (token) { 697 switch (token) {
697 case Token::NULL_LITERAL: 698 case Token::NULL_LITERAL:
698 return factory->NewNullLiteral(pos); 699 return factory->NewNullLiteral(pos);
699 case Token::TRUE_LITERAL: 700 case Token::TRUE_LITERAL:
(...skipping 6278 matching lines...) Expand 10 before | Expand all | Expand 10 after
6978 try_block, target); 6979 try_block, target);
6979 final_loop = target; 6980 final_loop = target;
6980 } 6981 }
6981 6982
6982 return final_loop; 6983 return final_loop;
6983 } 6984 }
6984 6985
6985 6986
6986 } // namespace internal 6987 } // namespace internal
6987 } // namespace v8 6988 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/ppc/builtins-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698