Index: runtime/vm/ast.h |
diff --git a/runtime/vm/ast.h b/runtime/vm/ast.h |
index 7c1279b4fa58df4e01c3b4a5025664d3e6afa18f..62eb4bbf55c0f842dabe7a052bc8428a9a9a2fd3 100644 |
--- a/runtime/vm/ast.h |
+++ b/runtime/vm/ast.h |
@@ -17,6 +17,7 @@ namespace dart { |
#define FOR_EACH_NODE(V) \ |
V(Await) \ |
+ V(AwaitMarker) \ |
V(Return) \ |
V(Literal) \ |
V(Type) \ |
@@ -168,6 +169,33 @@ class AwaitNode : public AstNode { |
}; |
+class AwaitMarkerNode : public AstNode { |
+ public: |
+ enum Type { |
+ kNewContinuationState, |
+ kTargetForContinuation, |
+ }; |
+ |
+ explicit AwaitMarkerNode(Type type) |
+ : AstNode(Scanner::kNoSourcePos), type_(type) { } |
+ |
+ void VisitChildren(AstNodeVisitor* visitor) const { } |
+ |
+ Type type() const { return type_; } |
+ |
+ LocalScope* scope() const { return scope_; } |
+ void set_scope(LocalScope* scope) { scope_ = scope; } |
+ |
+ DECLARE_COMMON_NODE_FUNCTIONS(AwaitMarkerNode); |
+ |
+ private: |
+ Type type_; |
+ LocalScope* scope_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(AwaitMarkerNode); |
+}; |
+ |
+ |
class SequenceNode : public AstNode { |
public: |
SequenceNode(intptr_t token_pos, LocalScope* scope) |
@@ -537,8 +565,6 @@ class PrimaryNode : public AstNode { |
}; |
-// TODO(mlippautz): Implement return nodes that are used to return from a |
-// continuation. |
class ReturnNode : public AstNode { |
public: |
// Return from a void function returns the null object. |
@@ -580,6 +606,9 @@ class ReturnNode : public AstNode { |
// Returns false if the return node is used to return from a continuation. |
bool is_regular_return() const { return is_regular_return_; } |
+ void set_is_regular_return(bool is_regular_return) { |
+ is_regular_return_ = is_regular_return; |
+ } |
DECLARE_COMMON_NODE_FUNCTIONS(ReturnNode); |