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

Unified Diff: runtime/vm/parser.h

Issue 536543002: Revert "Fix scoping async functions." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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/ast_transformer.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 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);
};
« no previous file with comments | « runtime/vm/ast_transformer.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698