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:js_runtime/shared/embedded_names.dart'; | 5 import 'package:js_runtime/shared/embedded_names.dart'; |
6 import 'package:kernel/ast.dart' as ir; | 6 import 'package:kernel/ast.dart' as ir; |
7 | 7 |
8 import '../closure.dart'; | 8 import '../closure.dart'; |
9 import '../common.dart'; | 9 import '../common.dart'; |
10 import '../compiler.dart'; | 10 import '../compiler.dart'; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 ConstantValue getFieldConstantValue(ir.Field field) { | 104 ConstantValue getFieldConstantValue(ir.Field field) { |
105 FieldElement element = getField(field); | 105 FieldElement element = getField(field); |
106 if (element.constant != null) { | 106 if (element.constant != null) { |
107 return computeConstantValue(element.constant); | 107 return computeConstantValue(element.constant); |
108 } | 108 } |
109 return null; | 109 return null; |
110 } | 110 } |
111 | 111 |
112 /// Called to find the corresponding Kernel element for a particular Element | 112 /// Called to find the corresponding Kernel element for a particular Element |
113 /// before traversing over it with a Kernel visitor. | 113 /// before traversing over it with a Kernel visitor. |
114 ir.Node getInitialKernelNode(MemberElement originTarget) { | 114 ir.Node getMemberNode(MemberElement originTarget) { |
115 ir.Node target; | 115 ir.Node target; |
116 if (originTarget.isPatch) { | 116 if (originTarget.isPatch) { |
117 originTarget = originTarget.origin; | 117 originTarget = originTarget.origin; |
118 } | 118 } |
119 if (originTarget is MethodElement) { | 119 if (originTarget is MethodElement) { |
120 if (originTarget is ConstructorBodyElement) { | 120 if (originTarget is ConstructorBodyElement) { |
121 ConstructorBodyElement body = originTarget; | 121 ConstructorBodyElement body = originTarget; |
122 originTarget = body.constructor; | 122 originTarget = body.constructor; |
123 } | 123 } |
124 target = kernel.functions[originTarget]; | 124 target = kernel.functions[originTarget]; |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 TypeMask selectorTypeOf(Selector selector, TypeMask mask) { | 643 TypeMask selectorTypeOf(Selector selector, TypeMask mask) { |
644 return TypeMaskFactory.inferredTypeForSelector( | 644 return TypeMaskFactory.inferredTypeForSelector( |
645 selector, mask, _globalInferenceResults); | 645 selector, mask, _globalInferenceResults); |
646 } | 646 } |
647 | 647 |
648 TypeMask typeFromNativeBehavior( | 648 TypeMask typeFromNativeBehavior( |
649 native.NativeBehavior nativeBehavior, ClosedWorld closedWorld) { | 649 native.NativeBehavior nativeBehavior, ClosedWorld closedWorld) { |
650 return TypeMaskFactory.fromNativeBehavior(nativeBehavior, closedWorld); | 650 return TypeMaskFactory.fromNativeBehavior(nativeBehavior, closedWorld); |
651 } | 651 } |
652 } | 652 } |
OLD | NEW |