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

Side by Side Diff: runtime/vm/parser.cc

Issue 3004033002: [VM generic functions reification] Support generic async* and sync* functions. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/parser.h" 5 #include "vm/parser.h"
6 #include "vm/flags.h" 6 #include "vm/flags.h"
7 7
8 #ifndef DART_PRECOMPILED_RUNTIME 8 #ifndef DART_PRECOMPILED_RUNTIME
9 9
10 #include "lib/invocation_mirror.h" 10 #include "lib/invocation_mirror.h"
(...skipping 3718 matching lines...) Expand 10 before | Expand all | Expand 10 after
3729 &func)); // Unpatched external function. 3729 &func)); // Unpatched external function.
3730 end_token_pos = TokenPos(); 3730 end_token_pos = TokenPos();
3731 } else { 3731 } else {
3732 UnexpectedToken(); 3732 UnexpectedToken();
3733 } 3733 }
3734 3734
3735 ASSERT(func.end_token_pos() == func.token_pos() || 3735 ASSERT(func.end_token_pos() == func.token_pos() ||
3736 func.end_token_pos() == end_token_pos); 3736 func.end_token_pos() == end_token_pos);
3737 func.set_end_token_pos(end_token_pos); 3737 func.set_end_token_pos(end_token_pos);
3738 SequenceNode* body = CloseBlock(); 3738 SequenceNode* body = CloseBlock();
3739 if (FLAG_reify_generic_functions && func.IsGeneric() &&
3740 !generated_body_closure.IsNull()) {
3741 LocalVariable* existing_var = body->scope()->LookupVariable(
3742 Symbols::FunctionTypeArgumentsVar(), false);
3743 ASSERT((existing_var != NULL) && existing_var->is_captured());
3744 }
3739 if (func.IsAsyncFunction()) { 3745 if (func.IsAsyncFunction()) {
3740 body = CloseAsyncFunction(generated_body_closure, body); 3746 body = CloseAsyncFunction(generated_body_closure, body);
3741 generated_body_closure.set_end_token_pos(end_token_pos); 3747 generated_body_closure.set_end_token_pos(end_token_pos);
3742 } else if (func.IsAsyncClosure()) { 3748 } else if (func.IsAsyncClosure()) {
3743 body = CloseAsyncClosure(body, end_token_pos); 3749 body = CloseAsyncClosure(body, end_token_pos);
3744 } else if (func.IsSyncGenerator()) { 3750 } else if (func.IsSyncGenerator()) {
3745 body = CloseSyncGenFunction(generated_body_closure, body); 3751 body = CloseSyncGenFunction(generated_body_closure, body);
3746 generated_body_closure.set_end_token_pos(end_token_pos); 3752 generated_body_closure.set_end_token_pos(end_token_pos);
3747 } else if (func.IsSyncGenClosure()) { 3753 } else if (func.IsSyncGenClosure()) {
3748 // body is unchanged. 3754 // body is unchanged.
(...skipping 11369 matching lines...) Expand 10 before | Expand all | Expand 10 after
15118 bool Parser::FieldHasFunctionLiteralInitializer(const Field& field, 15124 bool Parser::FieldHasFunctionLiteralInitializer(const Field& field,
15119 TokenPosition* start, 15125 TokenPosition* start,
15120 TokenPosition* end) { 15126 TokenPosition* end) {
15121 UNREACHABLE(); 15127 UNREACHABLE();
15122 return false; 15128 return false;
15123 } 15129 }
15124 15130
15125 } // namespace dart 15131 } // namespace dart
15126 15132
15127 #endif // DART_PRECOMPILED_RUNTIME 15133 #endif // DART_PRECOMPILED_RUNTIME
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698