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

Side by Side Diff: pkg/compiler/lib/src/tree_ir/tree_ir_builder.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 tree_ir_builder; 5 library tree_ir_builder;
6 6
7 import '../dart2jslib.dart' as dart2js; 7 import '../dart2jslib.dart' as dart2js;
8 import '../elements/elements.dart'; 8 import '../elements/elements.dart';
9 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; 9 import '../cps_ir/cps_ir_nodes.dart' as cps_ir;
10 import '../util/util.dart' show CURRENT_ELEMENT_SPANNABLE; 10 import '../util/util.dart' show CURRENT_ELEMENT_SPANNABLE;
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 return new GetIndex(getVariableUse(node.object), 646 return new GetIndex(getVariableUse(node.object),
647 getVariableUse(node.index)); 647 getVariableUse(node.index));
648 } 648 }
649 649
650 Expression visitSetIndex(cps_ir.SetIndex node) { 650 Expression visitSetIndex(cps_ir.SetIndex node) {
651 return new SetIndex(getVariableUse(node.object), 651 return new SetIndex(getVariableUse(node.object),
652 getVariableUse(node.index), 652 getVariableUse(node.index),
653 getVariableUse(node.value)); 653 getVariableUse(node.value));
654 } 654 }
655 655
656 @override
657 NodeCallback visitAwait(cps_ir.Await node) {
658 Expression value = new Await(getVariableUse(node.input));
659 return makeCallExpression(node, value);
660 }
661
656 /********** UNUSED VISIT METHODS *************/ 662 /********** UNUSED VISIT METHODS *************/
657 663
658 unexpectedNode(cps_ir.Node node) { 664 unexpectedNode(cps_ir.Node node) {
659 internalError(CURRENT_ELEMENT_SPANNABLE, 'Unexpected IR node: $node'); 665 internalError(CURRENT_ELEMENT_SPANNABLE, 'Unexpected IR node: $node');
660 } 666 }
661 667
662 visitFunctionDefinition(cps_ir.FunctionDefinition node) { 668 visitFunctionDefinition(cps_ir.FunctionDefinition node) {
663 unexpectedNode(node); 669 unexpectedNode(node);
664 } 670 }
665 visitParameter(cps_ir.Parameter node) => unexpectedNode(node); 671 visitParameter(cps_ir.Parameter node) => unexpectedNode(node);
666 visitContinuation(cps_ir.Continuation node) => unexpectedNode(node); 672 visitContinuation(cps_ir.Continuation node) => unexpectedNode(node);
667 visitMutableVariable(cps_ir.MutableVariable node) => unexpectedNode(node); 673 visitMutableVariable(cps_ir.MutableVariable node) => unexpectedNode(node);
668 visitIsTrue(cps_ir.IsTrue node) => unexpectedNode(node); 674 visitIsTrue(cps_ir.IsTrue node) => unexpectedNode(node);
669 } 675 }
670 676
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698