| 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 dart2js.js_emitter.native_emitter; | 5 library dart2js.js_emitter.native_emitter; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../compiler.dart' show Compiler; | 8 import '../compiler.dart' show Compiler; |
| 9 import '../elements/types.dart' show DartType, FunctionType; | 9 import '../elements/types.dart' show DartType, FunctionType; |
| 10 import '../elements/entities.dart'; | 10 import '../elements/entities.dart'; |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 cls.nativeLeafTags = leafTags[cls].toList(growable: false); | 201 cls.nativeLeafTags = leafTags[cls].toList(growable: false); |
| 202 } | 202 } |
| 203 if (nonleafTags[cls] != null) { | 203 if (nonleafTags[cls] != null) { |
| 204 cls.nativeNonLeafTags = nonleafTags[cls].toList(growable: false); | 204 cls.nativeNonLeafTags = nonleafTags[cls].toList(growable: false); |
| 205 } | 205 } |
| 206 cls.nativeExtensions = extensionPoints[cls]; | 206 cls.nativeExtensions = extensionPoints[cls]; |
| 207 } | 207 } |
| 208 | 208 |
| 209 // Add properties containing the information needed to construct maps used | 209 // Add properties containing the information needed to construct maps used |
| 210 // by getNativeInterceptor and custom elements. | 210 // by getNativeInterceptor and custom elements. |
| 211 if (compiler.enqueuer.codegen.nativeEnqueuer.hasInstantiatedNativeClasses) { | 211 if (backend.nativeCodegenEnqueuer.hasInstantiatedNativeClasses) { |
| 212 fillNativeInfo(jsInterceptorClass); | 212 fillNativeInfo(jsInterceptorClass); |
| 213 for (Class cls in classes) { | 213 for (Class cls in classes) { |
| 214 if (!cls.isNative || neededClasses.contains(cls)) { | 214 if (!cls.isNative || neededClasses.contains(cls)) { |
| 215 fillNativeInfo(cls); | 215 fillNativeInfo(cls); |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 } | 218 } |
| 219 | 219 |
| 220 // TODO(sra): Issue #13731- this is commented out as part of custom | 220 // TODO(sra): Issue #13731- this is commented out as part of custom |
| 221 // element constructor work. | 221 // element constructor work. |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 // satisfy a check against [element], in which case an interceptor must be | 364 // satisfy a check against [element], in which case an interceptor must be |
| 365 // used. We should also use an interceptor if the check can't be satisfied | 365 // used. We should also use an interceptor if the check can't be satisfied |
| 366 // by a native class in case we get a native instance that tries to spoof | 366 // by a native class in case we get a native instance that tries to spoof |
| 367 // the type info. i.e the criteria for whether or not to use an interceptor | 367 // the type info. i.e the criteria for whether or not to use an interceptor |
| 368 // is whether the receiver can be native, not the type of the test. | 368 // is whether the receiver can be native, not the type of the test. |
| 369 ClassEntity cls = element; | 369 ClassEntity cls = element; |
| 370 if (nativeData.isNativeOrExtendsNative(cls)) return true; | 370 if (nativeData.isNativeOrExtendsNative(cls)) return true; |
| 371 return isSupertypeOfNativeClass(element); | 371 return isSupertypeOfNativeClass(element); |
| 372 } | 372 } |
| 373 } | 373 } |
| OLD | NEW |