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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_nodes.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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
index 53960b5a4e411e9688559f1fbdab6b2ae38f543b..fcd6e76bff9f6ec4fa2a54d43c847f487818e077 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
@@ -1087,6 +1087,20 @@ class TypeExpression extends Primitive {
bool get isSafeForReordering => true;
}
+class Await extends CallExpression {
+ final Reference<Primitive> input;
+ final Reference<Continuation> continuation;
+
+ Await(Primitive input, Continuation continuation)
+ : this.input = new Reference<Primitive>(input),
+ this.continuation = new Reference<Continuation>(continuation);
+
+ @override
+ accept(Visitor visitor) {
+ return visitor.visitAwait(this);
+ }
+}
+
List<Reference<Primitive>> _referenceList(Iterable<Primitive> definitions) {
return definitions.map((e) => new Reference<Primitive>(e)).toList();
}
@@ -1118,6 +1132,7 @@ abstract class Visitor<T> {
T visitGetLazyStatic(GetLazyStatic node);
T visitSetField(SetField node);
T visitUnreachable(Unreachable node);
+ T visitAwait(Await node);
// Definitions.
T visitLiteralList(LiteralList node);
@@ -1423,6 +1438,13 @@ class LeafVisitor implements Visitor {
processUnreachable(node);
}
+ processAwait(Await node) {}
+ visitAwait(Await node) {
+ processAwait(node);
+ processReference(node.input);
+ processReference(node.continuation);
+ }
+
processGetLength(GetLength node) {}
visitGetLength(GetLength node) {
processGetLength(node);

Powered by Google App Engine
This is Rietveld 408576698