OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library dart2js.cps_ir.type_propagation; | 4 library dart2js.cps_ir.type_propagation; |
5 | 5 |
6 import 'optimizers.dart'; | 6 import 'optimizers.dart'; |
7 | 7 |
8 import '../closure.dart' show | 8 import '../closure.dart' show |
9 ClosureClassElement; | 9 ClosureClassElement; |
10 import '../common.dart'; | 10 import '../common.dart'; |
(...skipping 3009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3020 // TODO(asgerf): Add the NullInterceptor when it enables us to | 3020 // TODO(asgerf): Add the NullInterceptor when it enables us to |
3021 // propagate an assignment. | 3021 // propagate an assignment. |
3022 setValue(node, nonConstant()); | 3022 setValue(node, nonConstant()); |
3023 } else { | 3023 } else { |
3024 setValue(node, nonConstant(typeSystem.nonNullType)); | 3024 setValue(node, nonConstant(typeSystem.nonNullType)); |
3025 } | 3025 } |
3026 } | 3026 } |
3027 | 3027 |
3028 void visitGetField(GetField node) { | 3028 void visitGetField(GetField node) { |
3029 node.objectIsNotNull = getValue(node.object.definition).isDefinitelyNotNull; | 3029 node.objectIsNotNull = getValue(node.object.definition).isDefinitelyNotNull; |
3030 setValue(node, nonConstant(typeSystem.getFieldType(node.field))); | 3030 setValue(node, lattice.fromMask(typeSystem.getFieldType(node.field))); |
3031 } | 3031 } |
3032 | 3032 |
3033 void visitSetField(SetField node) {} | 3033 void visitSetField(SetField node) {} |
3034 | 3034 |
3035 void visitCreateBox(CreateBox node) { | 3035 void visitCreateBox(CreateBox node) { |
3036 setValue(node, nonConstant(typeSystem.nonNullType)); | 3036 setValue(node, nonConstant(typeSystem.nonNullType)); |
3037 } | 3037 } |
3038 | 3038 |
3039 void visitCreateInstance(CreateInstance node) { | 3039 void visitCreateInstance(CreateInstance node) { |
3040 setValue(node, nonConstant(typeSystem.nonNullExact(node.classElement.declara
tion))); | 3040 setValue(node, nonConstant(typeSystem.nonNullExact(node.classElement.declara
tion))); |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3230 processLetPrim(LetPrim node) { | 3230 processLetPrim(LetPrim node) { |
3231 node.primitive.type = null; | 3231 node.primitive.type = null; |
3232 values[node.primitive] = null; | 3232 values[node.primitive] = null; |
3233 } | 3233 } |
3234 | 3234 |
3235 processLetMutable(LetMutable node) { | 3235 processLetMutable(LetMutable node) { |
3236 node.variable.type = null; | 3236 node.variable.type = null; |
3237 values[node.variable] = null; | 3237 values[node.variable] = null; |
3238 } | 3238 } |
3239 } | 3239 } |
OLD | NEW |