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

Unified Diff: pkg/compiler/lib/src/ssa/nodes.dart

Issue 839323003: Implementation of async-await transformation on js ast. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 5 years, 10 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 | « pkg/compiler/lib/src/ssa/codegen.dart ('k') | pkg/compiler/lib/src/ssa/ssa.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/nodes.dart
diff --git a/pkg/compiler/lib/src/ssa/nodes.dart b/pkg/compiler/lib/src/ssa/nodes.dart
index 7337b7b14c7a41568c706f8ce58ad313f60a836d..534fd5714d054753c0949e53703dd6080793e7cc 100644
--- a/pkg/compiler/lib/src/ssa/nodes.dart
+++ b/pkg/compiler/lib/src/ssa/nodes.dart
@@ -6,6 +6,7 @@ part of ssa;
abstract class HVisitor<R> {
R visitAdd(HAdd node);
+ R visitAwait(HAwait node);
R visitBitAnd(HBitAnd node);
R visitBitNot(HBitNot node);
R visitBitOr(HBitOr node);
@@ -71,6 +72,7 @@ abstract class HVisitor<R> {
R visitTry(HTry node);
R visitTypeConversion(HTypeConversion node);
R visitTypeKnown(HTypeKnown node);
+ R visitYield(HYield node);
R visitReadTypeVariable(HReadTypeVariable node);
R visitFunctionType(HFunctionType node);
R visitVoidType(HVoidType node);
@@ -354,6 +356,8 @@ class HBaseVisitor extends HGraphVisitor implements HVisitor {
visitVoidType(HVoidType node) => visitInstruction(node);
visitInterfaceType(HInterfaceType node) => visitInstruction(node);
visitDynamicType(HDynamicType node) => visitInstruction(node);
+ visitAwait(HAwait node) => visitInstruction(node);
+ visitYield(HYield node) => visitInstruction(node);
}
class SubGraph {
@@ -2234,6 +2238,26 @@ class HThrowExpression extends HInstruction {
bool canThrow() => true;
}
+class HAwait extends HInstruction {
+ HAwait(HInstruction value, TypeMask type)
+ : super(<HInstruction>[value], type);
+ toString() => 'await';
+ accept(HVisitor visitor) => visitor.visitAwait(this);
+ // An await will throw if its argument is not a real future.
+ bool canThrow() => true;
+ SideEffects sideEffects = new SideEffects();
+}
+
+class HYield extends HInstruction {
+ HYield(HInstruction value, this.hasStar)
+ : super(<HInstruction>[value], const TypeMask.nonNullEmpty());
+ bool hasStar;
+ toString() => 'yield';
+ accept(HVisitor visitor) => visitor.visitYield(this);
+ bool canThrow() => false;
+ SideEffects sideEffects = new SideEffects();
+}
+
class HThrow extends HControlFlow {
final bool isRethrow;
HThrow(value, {this.isRethrow: false}) : super(<HInstruction>[value]);
« no previous file with comments | « pkg/compiler/lib/src/ssa/codegen.dart ('k') | pkg/compiler/lib/src/ssa/ssa.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698