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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart

Issue 1253333002: dart2js cps: Support async/await by rewriting the JavaScript AST. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add issue number to status file. Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library dart2js.ir_nodes_sexpr; 5 library dart2js.ir_nodes_sexpr;
6 6
7 import '../constants/values.dart'; 7 import '../constants/values.dart';
8 import '../util/util.dart'; 8 import '../util/util.dart';
9 import 'cps_ir_nodes.dart'; 9 import 'cps_ir_nodes.dart';
10 import '../universe/universe.dart' show Selector, CallStructure; 10 import '../universe/universe.dart' show Selector, CallStructure;
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 String index = access(node.index); 343 String index = access(node.index);
344 return '(GetIndex $object $index)'; 344 return '(GetIndex $object $index)';
345 } 345 }
346 346
347 String visitSetIndex(SetIndex node) { 347 String visitSetIndex(SetIndex node) {
348 String object = access(node.object); 348 String object = access(node.object);
349 String index = access(node.index); 349 String index = access(node.index);
350 String value = access(node.value); 350 String value = access(node.value);
351 return '(SetIndex $object $index $value)'; 351 return '(SetIndex $object $index $value)';
352 } 352 }
353
354 @override
355 String visitAwait(Await node) {
356 String value = access(node.input);
357 String continuation = access(node.continuation);
358 return '(Await $value $continuation)';
359 }
353 } 360 }
354 361
355 class ConstantStringifier extends ConstantValueVisitor<String, Null> { 362 class ConstantStringifier extends ConstantValueVisitor<String, Null> {
356 // Some of these methods are unimplemented because we haven't had a need 363 // Some of these methods are unimplemented because we haven't had a need
357 // to print such constants. When printing is implemented, the corresponding 364 // to print such constants. When printing is implemented, the corresponding
358 // parsing support should be added to SExpressionUnstringifier.parseConstant 365 // parsing support should be added to SExpressionUnstringifier.parseConstant
359 // in the dart2js tests (currently in the file 366 // in the dart2js tests (currently in the file
360 // tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart). 367 // tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart).
361 368
362 String _failWith(ConstantValue constant) { 369 String _failWith(ConstantValue constant) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 void setReturnContinuation(Continuation node) { 464 void setReturnContinuation(Continuation node) {
458 assert(!_names.containsKey(node) || _names[node] == 'return'); 465 assert(!_names.containsKey(node) || _names[node] == 'return');
459 _names[node] = 'return'; 466 _names[node] = 'return';
460 } 467 }
461 468
462 String getName(Node node) { 469 String getName(Node node) {
463 if (!_names.containsKey(node)) return 'MISSING_NAME'; 470 if (!_names.containsKey(node)) return 'MISSING_NAME';
464 return _names[node]; 471 return _names[node];
465 } 472 }
466 } 473 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698