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

Side by Side Diff: runtime/vm/parser.h

Issue 944893005: Implement async* functions in VM (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_PARSER_H_ 5 #ifndef VM_PARSER_H_
6 #define VM_PARSER_H_ 6 #define VM_PARSER_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 9
10 #include "platform/assert.h" 10 #include "platform/assert.h"
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 void ChainNewBlock(LocalScope* outer_scope); 556 void ChainNewBlock(LocalScope* outer_scope);
557 void OpenBlock(); 557 void OpenBlock();
558 void OpenLoopBlock(); 558 void OpenLoopBlock();
559 void OpenFunctionBlock(const Function& func); 559 void OpenFunctionBlock(const Function& func);
560 void OpenAsyncClosure(); 560 void OpenAsyncClosure();
561 RawFunction* OpenAsyncFunction(intptr_t formal_param_pos); 561 RawFunction* OpenAsyncFunction(intptr_t formal_param_pos);
562 RawFunction* OpenSyncGeneratorFunction(intptr_t func_pos); 562 RawFunction* OpenSyncGeneratorFunction(intptr_t func_pos);
563 SequenceNode* CloseSyncGenFunction(const Function& closure, 563 SequenceNode* CloseSyncGenFunction(const Function& closure,
564 SequenceNode* closure_node); 564 SequenceNode* closure_node);
565 void AddSyncGenClosureParameters(ParamList* params); 565 void AddSyncGenClosureParameters(ParamList* params);
566 void AddAsyncGenClosureParameters(ParamList* params);
567
568 // Support for async* functions.
569 RawFunction* OpenAsyncGeneratorFunction(intptr_t func_pos);
570 SequenceNode* CloseAsyncGeneratorFunction(const Function& closure,
571 SequenceNode* closure_node);
572 void OpenAsyncGeneratorClosure();
573 SequenceNode* CloseAsyncGeneratorClosure(SequenceNode* body);
574
566 void OpenAsyncTryBlock(); 575 void OpenAsyncTryBlock();
567 SequenceNode* CloseBlock(); 576 SequenceNode* CloseBlock();
568 SequenceNode* CloseAsyncFunction(const Function& closure, 577 SequenceNode* CloseAsyncFunction(const Function& closure,
569 SequenceNode* closure_node); 578 SequenceNode* closure_node);
579
570 SequenceNode* CloseAsyncClosure(SequenceNode* body); 580 SequenceNode* CloseAsyncClosure(SequenceNode* body);
571 SequenceNode* CloseAsyncTryBlock(SequenceNode* try_block); 581 SequenceNode* CloseAsyncTryBlock(SequenceNode* try_block);
582 SequenceNode* CloseAsyncGeneratorTryBlock(SequenceNode *body);
583
572 void AddAsyncClosureParameters(ParamList* params); 584 void AddAsyncClosureParameters(ParamList* params);
573 void AddContinuationVariables(); 585 void AddContinuationVariables();
574 void AddAsyncClosureVariables(); 586 void AddAsyncClosureVariables();
575 587 void AddAsyncGeneratorVariables();
576 588
577 LocalVariable* LookupPhaseParameter(); 589 LocalVariable* LookupPhaseParameter();
578 LocalVariable* LookupReceiver(LocalScope* from_scope, bool test_only); 590 LocalVariable* LookupReceiver(LocalScope* from_scope, bool test_only);
579 LocalVariable* LookupTypeArgumentsParameter(LocalScope* from_scope, 591 LocalVariable* LookupTypeArgumentsParameter(LocalScope* from_scope,
580 bool test_only); 592 bool test_only);
581 void CaptureInstantiator(); 593 void CaptureInstantiator();
582 AstNode* LoadReceiver(intptr_t token_pos); 594 AstNode* LoadReceiver(intptr_t token_pos);
583 AstNode* LoadFieldIfUnresolved(AstNode* node); 595 AstNode* LoadFieldIfUnresolved(AstNode* node);
584 AstNode* LoadClosure(PrimaryNode* primary); 596 AstNode* LoadClosure(PrimaryNode* primary);
585 AstNode* CallGetter(intptr_t token_pos, AstNode* object, const String& name); 597 AstNode* CallGetter(intptr_t token_pos, AstNode* object, const String& name);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 void AddFinallyBlockToNode(AstNode* node, InlinedFinallyNode* finally_node); 633 void AddFinallyBlockToNode(AstNode* node, InlinedFinallyNode* finally_node);
622 AstNode* ParseTryStatement(String* label_name); 634 AstNode* ParseTryStatement(String* label_name);
623 RawAbstractType* ParseConstFinalVarOrType( 635 RawAbstractType* ParseConstFinalVarOrType(
624 ClassFinalizer::FinalizationKind finalization); 636 ClassFinalizer::FinalizationKind finalization);
625 AstNode* ParseVariableDeclaration(const AbstractType& type, 637 AstNode* ParseVariableDeclaration(const AbstractType& type,
626 bool is_final, 638 bool is_final,
627 bool is_const, 639 bool is_const,
628 SequenceNode** await_preamble); 640 SequenceNode** await_preamble);
629 AstNode* ParseVariableDeclarationList(); 641 AstNode* ParseVariableDeclarationList();
630 AstNode* ParseFunctionStatement(bool is_literal); 642 AstNode* ParseFunctionStatement(bool is_literal);
643 AstNode* ParseYieldStatement();
631 AstNode* ParseStatement(); 644 AstNode* ParseStatement();
632 SequenceNode* ParseNestedStatement(bool parsing_loop_body, 645 SequenceNode* ParseNestedStatement(bool parsing_loop_body,
633 SourceLabel* label); 646 SourceLabel* label);
634 void ParseStatementSequence(); 647 void ParseStatementSequence();
635 bool IsIdentifier(); 648 bool IsIdentifier();
636 bool IsSimpleLiteral(const AbstractType& type, Instance* value); 649 bool IsSimpleLiteral(const AbstractType& type, Instance* value);
637 bool IsFunctionTypeAliasName(); 650 bool IsFunctionTypeAliasName();
638 bool IsMixinAppAlias(); 651 bool IsMixinAppAlias();
639 bool TryParseQualIdent(); 652 bool TryParseQualIdent();
640 bool TryParseTypeParameters(); 653 bool TryParseTypeParameters();
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 bool unregister_pending_function_; 851 bool unregister_pending_function_;
839 852
840 LocalScope* async_temp_scope_; 853 LocalScope* async_temp_scope_;
841 854
842 DISALLOW_COPY_AND_ASSIGN(Parser); 855 DISALLOW_COPY_AND_ASSIGN(Parser);
843 }; 856 };
844 857
845 } // namespace dart 858 } // namespace dart
846 859
847 #endif // VM_PARSER_H_ 860 #endif // VM_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698