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

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: Implement new ssa-nodes in ssa-tracer. Created 5 years, 11 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/ssa/nodes.dart
diff --git a/pkg/compiler/lib/src/ssa/nodes.dart b/pkg/compiler/lib/src/ssa/nodes.dart
index 7337b7b14c7a41568c706f8ce58ad313f60a836d..6a643ed8890b5526c8ec9788af3505b9505b56d8 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,25 @@ 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);
+ bool canThrow() => inputs[0].canThrow(); // TODO is this true?
floitsch 2015/02/02 22:00:11 I don't think that's correct. I believe an await
sigurdm 2015/02/03 16:59:32 Thanks
+ 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() => inputs[0].canThrow(); // TODO is this true?
floitsch 2015/02/02 22:00:11 ditto. I don't think this is correct. This should
sigurdm 2015/02/03 16:59:32 Done.
+ SideEffects sideEffects = new SideEffects();
+}
+
class HThrow extends HControlFlow {
final bool isRethrow;
HThrow(value, {this.isRethrow: false}) : super(<HInstruction>[value]);

Powered by Google App Engine
This is Rietveld 408576698