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

Side by Side 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, 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of ssa; 5 part of ssa;
6 6
7 abstract class HVisitor<R> { 7 abstract class HVisitor<R> {
8 R visitAdd(HAdd node); 8 R visitAdd(HAdd node);
9 R visitAwait(HAwait node);
9 R visitBitAnd(HBitAnd node); 10 R visitBitAnd(HBitAnd node);
10 R visitBitNot(HBitNot node); 11 R visitBitNot(HBitNot node);
11 R visitBitOr(HBitOr node); 12 R visitBitOr(HBitOr node);
12 R visitBitXor(HBitXor node); 13 R visitBitXor(HBitXor node);
13 R visitBoolify(HBoolify node); 14 R visitBoolify(HBoolify node);
14 R visitBoundsCheck(HBoundsCheck node); 15 R visitBoundsCheck(HBoundsCheck node);
15 R visitBreak(HBreak node); 16 R visitBreak(HBreak node);
16 R visitConstant(HConstant node); 17 R visitConstant(HConstant node);
17 R visitContinue(HContinue node); 18 R visitContinue(HContinue node);
18 R visitDivide(HDivide node); 19 R visitDivide(HDivide node);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 R visitStringify(HStringify node); 65 R visitStringify(HStringify node);
65 R visitSubtract(HSubtract node); 66 R visitSubtract(HSubtract node);
66 R visitSwitch(HSwitch node); 67 R visitSwitch(HSwitch node);
67 R visitThis(HThis node); 68 R visitThis(HThis node);
68 R visitThrow(HThrow node); 69 R visitThrow(HThrow node);
69 R visitThrowExpression(HThrowExpression node); 70 R visitThrowExpression(HThrowExpression node);
70 R visitTruncatingDivide(HTruncatingDivide node); 71 R visitTruncatingDivide(HTruncatingDivide node);
71 R visitTry(HTry node); 72 R visitTry(HTry node);
72 R visitTypeConversion(HTypeConversion node); 73 R visitTypeConversion(HTypeConversion node);
73 R visitTypeKnown(HTypeKnown node); 74 R visitTypeKnown(HTypeKnown node);
75 R visitYield(HYield node);
74 R visitReadTypeVariable(HReadTypeVariable node); 76 R visitReadTypeVariable(HReadTypeVariable node);
75 R visitFunctionType(HFunctionType node); 77 R visitFunctionType(HFunctionType node);
76 R visitVoidType(HVoidType node); 78 R visitVoidType(HVoidType node);
77 R visitInterfaceType(HInterfaceType node); 79 R visitInterfaceType(HInterfaceType node);
78 R visitDynamicType(HDynamicType node); 80 R visitDynamicType(HDynamicType node);
79 } 81 }
80 82
81 abstract class HGraphVisitor { 83 abstract class HGraphVisitor {
82 visitDominatorTree(HGraph graph) { 84 visitDominatorTree(HGraph graph) {
83 void visitBasicBlockAndSuccessors(HBasicBlock block) { 85 void visitBasicBlockAndSuccessors(HBasicBlock block) {
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 visitTry(HTry node) => visitControlFlow(node); 349 visitTry(HTry node) => visitControlFlow(node);
348 visitIs(HIs node) => visitInstruction(node); 350 visitIs(HIs node) => visitInstruction(node);
349 visitIsViaInterceptor(HIsViaInterceptor node) => visitInstruction(node); 351 visitIsViaInterceptor(HIsViaInterceptor node) => visitInstruction(node);
350 visitTypeConversion(HTypeConversion node) => visitCheck(node); 352 visitTypeConversion(HTypeConversion node) => visitCheck(node);
351 visitTypeKnown(HTypeKnown node) => visitCheck(node); 353 visitTypeKnown(HTypeKnown node) => visitCheck(node);
352 visitReadTypeVariable(HReadTypeVariable node) => visitInstruction(node); 354 visitReadTypeVariable(HReadTypeVariable node) => visitInstruction(node);
353 visitFunctionType(HFunctionType node) => visitInstruction(node); 355 visitFunctionType(HFunctionType node) => visitInstruction(node);
354 visitVoidType(HVoidType node) => visitInstruction(node); 356 visitVoidType(HVoidType node) => visitInstruction(node);
355 visitInterfaceType(HInterfaceType node) => visitInstruction(node); 357 visitInterfaceType(HInterfaceType node) => visitInstruction(node);
356 visitDynamicType(HDynamicType node) => visitInstruction(node); 358 visitDynamicType(HDynamicType node) => visitInstruction(node);
359 visitAwait(HAwait node) => visitInstruction(node);
360 visitYield(HYield node) => visitInstruction(node);
357 } 361 }
358 362
359 class SubGraph { 363 class SubGraph {
360 // The first and last block of the sub-graph. 364 // The first and last block of the sub-graph.
361 final HBasicBlock start; 365 final HBasicBlock start;
362 final HBasicBlock end; 366 final HBasicBlock end;
363 367
364 const SubGraph(this.start, this.end); 368 const SubGraph(this.start, this.end);
365 369
366 bool contains(HBasicBlock block) { 370 bool contains(HBasicBlock block) {
(...skipping 1860 matching lines...) Expand 10 before | Expand all | Expand 10 after
2227 } 2231 }
2228 2232
2229 class HThrowExpression extends HInstruction { 2233 class HThrowExpression extends HInstruction {
2230 HThrowExpression(value) 2234 HThrowExpression(value)
2231 : super(<HInstruction>[value], const TypeMask.nonNullEmpty()); 2235 : super(<HInstruction>[value], const TypeMask.nonNullEmpty());
2232 toString() => 'throw expression'; 2236 toString() => 'throw expression';
2233 accept(HVisitor visitor) => visitor.visitThrowExpression(this); 2237 accept(HVisitor visitor) => visitor.visitThrowExpression(this);
2234 bool canThrow() => true; 2238 bool canThrow() => true;
2235 } 2239 }
2236 2240
2241 class HAwait extends HInstruction {
2242 HAwait(HInstruction value, TypeMask type)
2243 : super(<HInstruction>[value], type);
2244 toString() => 'await';
2245 accept(HVisitor visitor) => visitor.visitAwait(this);
2246 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
2247 SideEffects sideEffects = new SideEffects();
2248 }
2249
2250 class HYield extends HInstruction {
2251 HYield(HInstruction value, this.hasStar)
2252 : super(<HInstruction>[value], const TypeMask.nonNullEmpty());
2253 bool hasStar;
2254 toString() => 'yield';
2255 accept(HVisitor visitor) => visitor.visitYield(this);
2256 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.
2257 SideEffects sideEffects = new SideEffects();
2258 }
2259
2237 class HThrow extends HControlFlow { 2260 class HThrow extends HControlFlow {
2238 final bool isRethrow; 2261 final bool isRethrow;
2239 HThrow(value, {this.isRethrow: false}) : super(<HInstruction>[value]); 2262 HThrow(value, {this.isRethrow: false}) : super(<HInstruction>[value]);
2240 toString() => 'throw'; 2263 toString() => 'throw';
2241 accept(HVisitor visitor) => visitor.visitThrow(this); 2264 accept(HVisitor visitor) => visitor.visitThrow(this);
2242 } 2265 }
2243 2266
2244 class HStatic extends HInstruction { 2267 class HStatic extends HInstruction {
2245 final Element element; 2268 final Element element;
2246 HStatic(this.element, type) : super(<HInstruction>[], type) { 2269 HStatic(this.element, type) : super(<HInstruction>[], type) {
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
3100 class HDynamicType extends HRuntimeType { 3123 class HDynamicType extends HRuntimeType {
3101 HDynamicType(DynamicType dartType, TypeMask instructionType) 3124 HDynamicType(DynamicType dartType, TypeMask instructionType)
3102 : super(const <HInstruction>[], dartType, instructionType); 3125 : super(const <HInstruction>[], dartType, instructionType);
3103 3126
3104 accept(HVisitor visitor) => visitor.visitDynamicType(this); 3127 accept(HVisitor visitor) => visitor.visitDynamicType(this);
3105 3128
3106 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; 3129 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE;
3107 3130
3108 bool typeEquals(HInstruction other) => other is HDynamicType; 3131 bool typeEquals(HInstruction other) => other is HDynamicType;
3109 } 3132 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698