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

Unified Diff: runtime/vm/ast.h

Issue 460763002: Fix returning from async functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: first set of comments Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast.h
diff --git a/runtime/vm/ast.h b/runtime/vm/ast.h
index 03d65a06f3561c9161e330c1ec2dadd0a08eb75a..c68460d237d3a3c601603613aad9e55e89fdb674 100644
--- a/runtime/vm/ast.h
+++ b/runtime/vm/ast.h
@@ -162,7 +162,7 @@ class SequenceNode : public AstNode {
void VisitChildren(AstNodeVisitor* visitor) const;
- void Add(AstNode* node) { nodes_.Add(node); }
+ void Add(AstNode* node);
intptr_t length() const { return nodes_.length(); }
AstNode* NodeAt(intptr_t index) const { return nodes_[index]; }
void ReplaceNodeAt(intptr_t index, AstNode* value) { nodes_[index] = value; }
@@ -522,14 +522,16 @@ class ReturnNode : public AstNode {
: AstNode(token_pos),
value_(new LiteralNode(token_pos, Instance::ZoneHandle())),
inlined_finally_list_(),
- saved_return_value_var_(NULL) { }
+ saved_return_value_var_(NULL),
+ is_regular_return_(true) { }
// Return from a non-void function.
ReturnNode(intptr_t token_pos,
AstNode* value)
: AstNode(token_pos),
value_(value),
inlined_finally_list_(),
- saved_return_value_var_(NULL) {
+ saved_return_value_var_(NULL),
+ is_regular_return_(true) {
ASSERT(value_ != NULL);
}
@@ -558,12 +560,20 @@ class ReturnNode : public AstNode {
}
}
+ void set_scope(LocalScope* scope) { scope_ = scope; }
+ LocalScope* scope() const { return scope_; }
+
+ // Returns true if the return node is not used to return from a continuation.
srdjan 2014/08/12 21:39:24 Simplify: returns false if the return node is used
Michael Lippautz (Google) 2014/08/12 21:50:51 Done.
+ bool is_regular_return() const { return is_regular_return_; }
+
DECLARE_COMMON_NODE_FUNCTIONS(ReturnNode);
private:
AstNode* value_;
GrowableArray<InlinedFinallyNode*> inlined_finally_list_;
LocalVariable* saved_return_value_var_;
+ LocalScope* scope_;
+ bool is_regular_return_;
DISALLOW_COPY_AND_ASSIGN(ReturnNode);
};
« no previous file with comments | « no previous file | runtime/vm/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698