OLD | NEW |
1 library dart2js.unsugar_cps; | 1 library dart2js.unsugar_cps; |
2 | 2 |
3 import '../../cps_ir/cps_ir_nodes.dart'; | 3 import '../../cps_ir/cps_ir_nodes.dart'; |
4 | 4 |
5 import '../../cps_ir/optimizers.dart' show ParentVisitor; | 5 import '../../cps_ir/optimizers.dart' show ParentVisitor; |
6 import '../../constants/expressions.dart'; | 6 import '../../constants/expressions.dart'; |
7 import '../../constants/values.dart'; | 7 import '../../constants/values.dart'; |
8 import '../../elements/elements.dart' show | 8 import '../../elements/elements.dart' show |
9 ClassElement, | 9 ClassElement, |
10 FieldElement, | 10 FieldElement, |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 visit(function); | 75 visit(function); |
76 } | 76 } |
77 | 77 |
78 @override | 78 @override |
79 visit(Node node) { | 79 visit(Node node) { |
80 Node result = node.accept(this); | 80 Node result = node.accept(this); |
81 return result != null ? result : node; | 81 return result != null ? result : node; |
82 } | 82 } |
83 | 83 |
84 Constant get trueConstant { | 84 Constant get trueConstant { |
85 return new Constant( | 85 return new Constant(new TrueConstantValue()); |
86 new BoolConstantExpression(true), | |
87 new TrueConstantValue()); | |
88 } | 86 } |
89 | 87 |
90 Constant get falseConstant { | 88 Constant get falseConstant { |
91 return new Constant( | 89 return new Constant(new FalseConstantValue()); |
92 new BoolConstantExpression(false), | |
93 new FalseConstantValue()); | |
94 } | 90 } |
95 | 91 |
96 Constant get nullConstant { | 92 Constant get nullConstant { |
97 return new Constant( | 93 return new Constant(new NullConstantValue()); |
98 new NullConstantExpression(), | |
99 new NullConstantValue()); | |
100 } | 94 } |
101 | 95 |
102 void insertLetPrim(Primitive primitive, Expression node) { | 96 void insertLetPrim(Primitive primitive, Expression node) { |
103 LetPrim let = new LetPrim(primitive); | 97 LetPrim let = new LetPrim(primitive); |
104 InteriorNode parent = node.parent; | 98 InteriorNode parent = node.parent; |
105 parent.body = let; | 99 parent.body = let; |
106 let.body = node; | 100 let.body = node; |
107 node.parent = let; | 101 node.parent = let; |
108 let.parent = parent; | 102 let.parent = parent; |
109 } | 103 } |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 condition.value.unlink(); | 279 condition.value.unlink(); |
286 node.trueContinuation.unlink(); | 280 node.trueContinuation.unlink(); |
287 node.falseContinuation.unlink(); | 281 node.falseContinuation.unlink(); |
288 parent.body = newNode; | 282 parent.body = newNode; |
289 } | 283 } |
290 | 284 |
291 processInterceptor(Interceptor node) { | 285 processInterceptor(Interceptor node) { |
292 _glue.registerSpecializedGetInterceptor(node.interceptedClasses); | 286 _glue.registerSpecializedGetInterceptor(node.interceptedClasses); |
293 } | 287 } |
294 } | 288 } |
OLD | NEW |