Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef V8_PARSING_PARSER_H_ | 5 #ifndef V8_PARSING_PARSER_H_ |
| 6 #define V8_PARSING_PARSER_H_ | 6 #define V8_PARSING_PARSER_H_ |
| 7 | 7 |
| 8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
| 9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
| 10 #include "src/base/compiler-specific.h" | 10 #include "src/base/compiler-specific.h" |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 448 const DeclarationDescriptor* descriptor_; | 448 const DeclarationDescriptor* descriptor_; |
| 449 ZoneList<const AstRawString*>* names_; | 449 ZoneList<const AstRawString*>* names_; |
| 450 Expression* current_value_; | 450 Expression* current_value_; |
| 451 int recursion_level_; | 451 int recursion_level_; |
| 452 bool* ok_; | 452 bool* ok_; |
| 453 | 453 |
| 454 DEFINE_AST_VISITOR_MEMBERS_WITHOUT_STACKOVERFLOW() | 454 DEFINE_AST_VISITOR_MEMBERS_WITHOUT_STACKOVERFLOW() |
| 455 }; | 455 }; |
| 456 | 456 |
| 457 // !%_IsJSReceiver(result = iterator.next()) && | 457 // !%_IsJSReceiver(result = iterator.next()) && |
| 458 // %ThrowIteratorResultNotAnObject(result) | 458 // %ThrowIteratorResultNotAnObject(result) |
|
neis
2017/01/24 12:49:19
Comment needs an update.
caitp
2017/01/24 22:51:55
done
| |
| 459 Expression* BuildIteratorNextResult(Expression* iterator, Variable* result, | 459 Expression* BuildIteratorNextResult(Expression* iterator, Variable* result, |
| 460 int pos); | 460 IteratorType type, int pos); |
| 461 | 461 |
| 462 // Initialize the components of a for-in / for-of statement. | 462 // Initialize the components of a for-in / for-of statement. |
| 463 Statement* InitializeForEachStatement(ForEachStatement* stmt, | 463 Statement* InitializeForEachStatement(ForEachStatement* stmt, |
| 464 Expression* each, Expression* subject, | 464 Expression* each, Expression* subject, |
| 465 Statement* body, int each_keyword_pos); | 465 Statement* body, int each_keyword_pos); |
| 466 Statement* InitializeForOfStatement(ForOfStatement* stmt, Expression* each, | 466 Statement* InitializeForOfStatement(ForEachStatement* stmt, Expression* each, |
| 467 Expression* iterable, Statement* body, | 467 Expression* iterable, Statement* body, |
| 468 bool finalize, | 468 bool finalize, IteratorType type, |
| 469 int next_result_pos = kNoSourcePosition); | 469 int next_result_pos = kNoSourcePosition); |
| 470 | |
| 470 Block* RewriteForVarInLegacy(const ForInfo& for_info); | 471 Block* RewriteForVarInLegacy(const ForInfo& for_info); |
| 471 void DesugarBindingInForEachStatement(ForInfo* for_info, Block** body_block, | 472 void DesugarBindingInForEachStatement(ForInfo* for_info, Block** body_block, |
| 472 Expression** each_variable, bool* ok); | 473 Expression** each_variable, bool* ok); |
| 473 Block* CreateForEachStatementTDZ(Block* init_block, const ForInfo& for_info, | 474 Block* CreateForEachStatementTDZ(Block* init_block, const ForInfo& for_info, |
| 474 bool* ok); | 475 bool* ok); |
| 475 | 476 |
| 476 Statement* DesugarLexicalBindingsInForStatement( | 477 Statement* DesugarLexicalBindingsInForStatement( |
| 477 ForStatement* loop, Statement* init, Expression* cond, Statement* next, | 478 ForStatement* loop, Statement* init, Expression* cond, Statement* next, |
| 478 Statement* body, Scope* inner_scope, const ForInfo& for_info, bool* ok); | 479 Statement* body, Scope* inner_scope, const ForInfo& for_info, bool* ok); |
| 479 | 480 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 631 Expression* BuildRejectPromise(Expression* value, int pos); | 632 Expression* BuildRejectPromise(Expression* value, int pos); |
| 632 Variable* PromiseVariable(); | 633 Variable* PromiseVariable(); |
| 633 | 634 |
| 634 // Generic AST generator for throwing errors from compiled code. | 635 // Generic AST generator for throwing errors from compiled code. |
| 635 Expression* NewThrowError(Runtime::FunctionId function_id, | 636 Expression* NewThrowError(Runtime::FunctionId function_id, |
| 636 MessageTemplate::Template message, | 637 MessageTemplate::Template message, |
| 637 const AstRawString* arg, int pos); | 638 const AstRawString* arg, int pos); |
| 638 | 639 |
| 639 void FinalizeIteratorUse(Scope* use_scope, Variable* completion, | 640 void FinalizeIteratorUse(Scope* use_scope, Variable* completion, |
| 640 Expression* condition, Variable* iter, | 641 Expression* condition, Variable* iter, |
| 641 Block* iterator_use, Block* result); | 642 Block* iterator_use, Block* result, |
| 643 IteratorType type); | |
| 642 | 644 |
| 643 Statement* FinalizeForOfStatement(ForOfStatement* loop, Variable* completion, | 645 Statement* FinalizeForOfStatement(ForOfStatement* loop, Variable* completion, |
| 644 int pos); | 646 IteratorType type, int pos); |
| 645 void BuildIteratorClose(ZoneList<Statement*>* statements, Variable* iterator, | 647 void BuildIteratorClose(ZoneList<Statement*>* statements, Variable* iterator, |
| 646 Variable* input, Variable* output); | 648 Variable* input, Variable* output); |
| 647 void BuildIteratorCloseForCompletion(Scope* scope, | 649 void BuildIteratorCloseForCompletion(Scope* scope, |
| 648 ZoneList<Statement*>* statements, | 650 ZoneList<Statement*>* statements, |
| 649 Variable* iterator, | 651 Variable* iterator, |
| 650 Expression* completion); | 652 Expression* completion, |
| 653 IteratorType type); | |
| 651 Statement* CheckCallable(Variable* var, Expression* error, int pos); | 654 Statement* CheckCallable(Variable* var, Expression* error, int pos); |
| 652 | 655 |
| 653 V8_INLINE Expression* RewriteAwaitExpression(Expression* value, int pos); | 656 V8_INLINE Expression* RewriteAwaitExpression(Expression* value, int pos); |
| 654 V8_INLINE void PrepareAsyncFunctionBody(ZoneList<Statement*>* body, | 657 V8_INLINE void PrepareAsyncFunctionBody(ZoneList<Statement*>* body, |
| 655 FunctionKind kind, int pos); | 658 FunctionKind kind, int pos); |
| 656 V8_INLINE void RewriteAsyncFunctionBody(ZoneList<Statement*>* body, | 659 V8_INLINE void RewriteAsyncFunctionBody(ZoneList<Statement*>* body, |
| 657 Block* block, | 660 Block* block, |
| 658 Expression* return_value, bool* ok); | 661 Expression* return_value, bool* ok); |
| 659 | 662 |
| 660 Expression* RewriteYieldStar(Expression* generator, Expression* expression, | 663 Expression* RewriteYieldStar(Expression* generator, Expression* expression, |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1176 | 1179 |
| 1177 private: | 1180 private: |
| 1178 ParserTarget** variable_; | 1181 ParserTarget** variable_; |
| 1179 ParserTarget* previous_; | 1182 ParserTarget* previous_; |
| 1180 }; | 1183 }; |
| 1181 | 1184 |
| 1182 } // namespace internal | 1185 } // namespace internal |
| 1183 } // namespace v8 | 1186 } // namespace v8 |
| 1184 | 1187 |
| 1185 #endif // V8_PARSING_PARSER_H_ | 1188 #endif // V8_PARSING_PARSER_H_ |
| OLD | NEW |