| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'package:kernel/ast.dart' as ir; | 5 import 'package:kernel/ast.dart' as ir; |
| 6 | 6 |
| 7 import '../closure.dart'; | 7 import '../closure.dart'; |
| 8 import '../common.dart'; | 8 import '../common.dart'; |
| 9 import '../compiler.dart'; | 9 import '../compiler.dart'; |
| 10 import '../constants/expressions.dart'; | 10 import '../constants/expressions.dart'; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 ConstantValue value = | 103 ConstantValue value = |
| 104 _compiler.backend.constants.getConstantValue(constant); | 104 _compiler.backend.constants.getConstantValue(constant); |
| 105 if (value == null && requireConstant) { | 105 if (value == null && requireConstant) { |
| 106 throw new UnsupportedError( | 106 throw new UnsupportedError( |
| 107 'No constant value for ${constant.toStructuredText()}'); | 107 'No constant value for ${constant.toStructuredText()}'); |
| 108 } | 108 } |
| 109 return value; | 109 return value; |
| 110 } | 110 } |
| 111 | 111 |
| 112 @override | 112 @override |
| 113 ConstantValue getFieldConstantValue(ir.Field field) { | 113 ConstantValue getFieldConstantValue(covariant FieldElement element) { |
| 114 FieldElement element = getField(field); | |
| 115 if (element.constant != null) { | 114 if (element.constant != null) { |
| 116 return computeConstantValue(element.constant); | 115 return computeConstantValue(element.constant); |
| 117 } | 116 } |
| 118 return null; | 117 return null; |
| 119 } | 118 } |
| 120 | 119 |
| 121 /// Called to find the corresponding Kernel element for a particular Element | 120 /// Called to find the corresponding Kernel element for a particular Element |
| 122 /// before traversing over it with a Kernel visitor. | 121 /// before traversing over it with a Kernel visitor. |
| 123 ir.Node getMemberNode(MemberElement originTarget) { | 122 ir.Node getMemberNode(MemberElement originTarget) { |
| 124 ir.Node target; | 123 ir.Node target; |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 TypeMask selectorTypeOf(Selector selector, TypeMask mask) { | 742 TypeMask selectorTypeOf(Selector selector, TypeMask mask) { |
| 744 return TypeMaskFactory.inferredTypeForSelector( | 743 return TypeMaskFactory.inferredTypeForSelector( |
| 745 selector, mask, _globalInferenceResults); | 744 selector, mask, _globalInferenceResults); |
| 746 } | 745 } |
| 747 | 746 |
| 748 TypeMask typeFromNativeBehavior( | 747 TypeMask typeFromNativeBehavior( |
| 749 native.NativeBehavior nativeBehavior, ClosedWorld closedWorld) { | 748 native.NativeBehavior nativeBehavior, ClosedWorld closedWorld) { |
| 750 return TypeMaskFactory.fromNativeBehavior(nativeBehavior, closedWorld); | 749 return TypeMaskFactory.fromNativeBehavior(nativeBehavior, closedWorld); |
| 751 } | 750 } |
| 752 } | 751 } |
| OLD | NEW |