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

Unified Diff: runtime/vm/parser.h

Issue 447003003: Introduce await (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed 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 | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.h
diff --git a/runtime/vm/parser.h b/runtime/vm/parser.h
index 2c5acf3e4c6a7969334c5eed3f3633f161a9afea..81aff04f9c5d74617a2958609b71c4e76fba9f07 100644
--- a/runtime/vm/parser.h
+++ b/runtime/vm/parser.h
@@ -48,11 +48,13 @@ class ParsedFunction : public ZoneAllocated {
saved_entry_context_var_(NULL),
expression_temp_var_(NULL),
finally_return_temp_var_(NULL),
+ await_temps_scope_(NULL),
deferred_prefixes_(new ZoneGrowableArray<const LibraryPrefix*>()),
first_parameter_index_(0),
first_stack_local_index_(0),
num_copied_params_(0),
num_stack_locals_(0),
+ have_seen_await_expr_(false),
isolate_(isolate) {
ASSERT(function.IsZoneHandle());
}
@@ -138,6 +140,21 @@ class ParsedFunction : public ZoneAllocated {
void AllocateVariables();
+ void set_await_temps_scope(LocalScope* scope) {
+ ASSERT(await_temps_scope_ == NULL);
+ await_temps_scope_ = scope;
+ }
+ LocalScope* await_temps_scope() const {
+ ASSERT(await_temps_scope_ != NULL);
+ return await_temps_scope_;
+ }
+
+ void record_await() {
+ have_seen_await_expr_ = true;
+ }
+ void reset_have_seen_await() { have_seen_await_expr_ = false; }
+ bool have_seen_await() const { return have_seen_await_expr_; }
+
Isolate* isolate() const { return isolate_; }
private:
@@ -150,12 +167,14 @@ class ParsedFunction : public ZoneAllocated {
LocalVariable* saved_entry_context_var_;
LocalVariable* expression_temp_var_;
LocalVariable* finally_return_temp_var_;
+ LocalScope* await_temps_scope_;
ZoneGrowableArray<const LibraryPrefix*>* deferred_prefixes_;
int first_parameter_index_;
int first_stack_local_index_;
int num_copied_params_;
int num_stack_locals_;
+ bool have_seen_await_expr_;
Isolate* isolate_;
@@ -502,6 +521,7 @@ class Parser : public ValueObject {
void OpenBlock();
void OpenLoopBlock();
void OpenFunctionBlock(const Function& func);
+ void OpenAsyncClosure();
RawFunction* OpenAsyncFunction(intptr_t formal_param_pos);
SequenceNode* CloseBlock();
SequenceNode* CloseAsyncFunction(const Function& closure,
@@ -586,6 +606,8 @@ class Parser : public ValueObject {
static const bool kAllowConst = false;
static const bool kConsumeCascades = true;
static const bool kNoCascades = false;
+ AstNode* ParseAwaitableExpr(bool require_compiletime_const,
+ bool consume_cascades);
AstNode* ParseExpr(bool require_compiletime_const, bool consume_cascades);
AstNode* ParseExprList();
AstNode* ParseConditionalExpr();
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698