| Index: runtime/vm/parser.h
|
| diff --git a/runtime/vm/parser.h b/runtime/vm/parser.h
|
| index 258a00994498fc7648f79cc41b5795822031b18a..d249655e9947fd59f05c10031ed9d09a4c967015 100644
|
| --- a/runtime/vm/parser.h
|
| +++ b/runtime/vm/parser.h
|
| @@ -48,6 +48,7 @@ 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),
|
| @@ -55,7 +56,7 @@ class ParsedFunction : public ZoneAllocated {
|
| num_stack_locals_(0),
|
| have_seen_await_expr_(false),
|
| saved_try_ctx_(NULL),
|
| - async_saved_try_ctx_name_(String::ZoneHandle(isolate, String::null())),
|
| + async_saved_try_ctx_(NULL),
|
| isolate_(isolate) {
|
| ASSERT(function.IsZoneHandle());
|
| }
|
| @@ -141,6 +142,15 @@ 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;
|
| }
|
| @@ -148,21 +158,20 @@ class ParsedFunction : public ZoneAllocated {
|
| bool have_seen_await() const { return have_seen_await_expr_; }
|
|
|
| void set_saved_try_ctx(LocalVariable* saved_try_ctx) {
|
| - ASSERT((saved_try_ctx == NULL) || !saved_try_ctx->is_captured());
|
| + ASSERT((saved_try_ctx != NULL) && !saved_try_ctx->is_captured());
|
| saved_try_ctx_ = saved_try_ctx;
|
| }
|
| LocalVariable* saved_try_ctx() const { return saved_try_ctx_; }
|
|
|
| - void set_async_saved_try_ctx_name(const String& async_saved_try_ctx_name) {
|
| - async_saved_try_ctx_name_ = async_saved_try_ctx_name.raw();
|
| - }
|
| - RawString* async_saved_try_ctx_name() const {
|
| - return async_saved_try_ctx_name_.raw();
|
| + void set_async_saved_try_ctx(LocalVariable* async_saved_try_ctx) {
|
| + ASSERT((async_saved_try_ctx != NULL) && async_saved_try_ctx->is_captured());
|
| + async_saved_try_ctx_ = async_saved_try_ctx;
|
| }
|
| + LocalVariable* async_saved_try_ctx() const { return async_saved_try_ctx_; }
|
|
|
| void reset_saved_try_ctx_vars() {
|
| saved_try_ctx_ = NULL;
|
| - async_saved_try_ctx_name_ = String::null();
|
| + async_saved_try_ctx_ = NULL;
|
| }
|
|
|
| Isolate* isolate() const { return isolate_; }
|
| @@ -177,6 +186,7 @@ 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_;
|
| @@ -185,7 +195,7 @@ class ParsedFunction : public ZoneAllocated {
|
| int num_stack_locals_;
|
| bool have_seen_await_expr_;
|
| LocalVariable* saved_try_ctx_;
|
| - String& async_saved_try_ctx_name_;
|
| + LocalVariable* async_saved_try_ctx_;
|
|
|
| Isolate* isolate_;
|
|
|
| @@ -547,7 +557,6 @@ class Parser : public ValueObject {
|
| SequenceNode* CloseAsyncFunction(const Function& closure,
|
| SequenceNode* closure_node);
|
| void CloseAsyncClosure(SequenceNode* body);
|
| - void AddAsyncClosureVariables();
|
|
|
|
|
| LocalVariable* LookupPhaseParameter();
|
| @@ -722,10 +731,9 @@ class Parser : public ValueObject {
|
| InvocationMirror::Type type,
|
| const Function* func);
|
|
|
| - void SetupSavedTryContext(LocalVariable* saved_try_context);
|
| - void RestoreSavedTryContext(LocalScope* saved_try_context_scope,
|
| - int16_t try_index,
|
| - SequenceNode* target);
|
| + void SetupSavedTryContext(LocalScope* saved_try_context_scope,
|
| + int16_t try_index,
|
| + SequenceNode* target);
|
|
|
| void CheckOperatorArity(const MemberDesc& member);
|
|
|
| @@ -809,8 +817,6 @@ class Parser : public ValueObject {
|
|
|
| bool unregister_pending_function_;
|
|
|
| - LocalScope* async_temp_scope_;
|
| -
|
| DISALLOW_COPY_AND_ASSIGN(Parser);
|
| };
|
|
|
|
|