| OLD | NEW |
| 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 library js_backend.backend; | 5 library js_backend.backend; |
| 6 | 6 |
| 7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
| 8 | 8 |
| 9 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; | 9 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; |
| 10 | 10 |
| (...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1092 registerBackendUse(helpers.createRuntimeType); | 1092 registerBackendUse(helpers.createRuntimeType); |
| 1093 } | 1093 } |
| 1094 impactBuilder.registerTypeUse( | 1094 impactBuilder.registerTypeUse( |
| 1095 new TypeUse.instantiation(backendClasses.typeImplementation.rawType)); | 1095 new TypeUse.instantiation(backendClasses.typeImplementation.rawType)); |
| 1096 } | 1096 } |
| 1097 lookupMapAnalysis.registerConstantKey(constant); | 1097 lookupMapAnalysis.registerConstantKey(constant); |
| 1098 } | 1098 } |
| 1099 | 1099 |
| 1100 void computeImpactForInstantiatedConstantType( | 1100 void computeImpactForInstantiatedConstantType( |
| 1101 DartType type, WorldImpactBuilder impactBuilder) { | 1101 DartType type, WorldImpactBuilder impactBuilder) { |
| 1102 DartType instantiatedType = | |
| 1103 type.isFunctionType ? commonElements.functionType : type; | |
| 1104 if (type is InterfaceType) { | 1102 if (type is InterfaceType) { |
| 1105 impactBuilder | 1103 impactBuilder.registerTypeUse(new TypeUse.instantiation(type)); |
| 1106 .registerTypeUse(new TypeUse.instantiation(instantiatedType)); | |
| 1107 if (classNeedsRtiField(type.element)) { | 1104 if (classNeedsRtiField(type.element)) { |
| 1108 impactBuilder.registerStaticUse(new StaticUse.staticInvoke( | 1105 impactBuilder.registerStaticUse(new StaticUse.staticInvoke( |
| 1109 // TODO(johnniwinther): Find the right [CallStructure]. | 1106 // TODO(johnniwinther): Find the right [CallStructure]. |
| 1110 helpers.setRuntimeTypeInfo, | 1107 helpers.setRuntimeTypeInfo, |
| 1111 null)); | 1108 null)); |
| 1112 } | 1109 } |
| 1113 if (type.element == backendClasses.typeImplementation) { | 1110 if (type.element == backendClasses.typeImplementation) { |
| 1114 // If we use a type literal in a constant, the compile time | 1111 // If we use a type literal in a constant, the compile time |
| 1115 // constant emitter will generate a call to the createRuntimeType | 1112 // constant emitter will generate a call to the createRuntimeType |
| 1116 // helper so we register a use of that. | 1113 // helper so we register a use of that. |
| (...skipping 2156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3273 @override | 3270 @override |
| 3274 bool isNativeClass(ClassElement element) { | 3271 bool isNativeClass(ClassElement element) { |
| 3275 return helpers.backend.isNative(element); | 3272 return helpers.backend.isNative(element); |
| 3276 } | 3273 } |
| 3277 | 3274 |
| 3278 @override | 3275 @override |
| 3279 bool isNativeMember(MemberElement element) { | 3276 bool isNativeMember(MemberElement element) { |
| 3280 return helpers.backend.isNative(element); | 3277 return helpers.backend.isNative(element); |
| 3281 } | 3278 } |
| 3282 } | 3279 } |
| OLD | NEW |