| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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.kernel.element_map; | 5 library dart2js.kernel.element_map; |
| 6 | 6 |
| 7 import 'package:kernel/ast.dart' as ir; | 7 import 'package:kernel/ast.dart' as ir; |
| 8 | 8 |
| 9 import '../common.dart'; | 9 import '../common.dart'; |
| 10 import '../common/names.dart' show Identifiers; | 10 import '../common/names.dart' show Identifiers; |
| (...skipping 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1316 } | 1316 } |
| 1317 | 1317 |
| 1318 InterfaceType getMixinTypeForClass(KClass cls) { | 1318 InterfaceType getMixinTypeForClass(KClass cls) { |
| 1319 _KClassEnv env = elementMap._classEnvs[cls.classIndex]; | 1319 _KClassEnv env = elementMap._classEnvs[cls.classIndex]; |
| 1320 ir.Supertype mixedInType = env.cls.mixedInType; | 1320 ir.Supertype mixedInType = env.cls.mixedInType; |
| 1321 if (mixedInType == null) return null; | 1321 if (mixedInType == null) return null; |
| 1322 return elementMap.createInterfaceType( | 1322 return elementMap.createInterfaceType( |
| 1323 mixedInType.classNode, mixedInType.typeArguments); | 1323 mixedInType.classNode, mixedInType.typeArguments); |
| 1324 } | 1324 } |
| 1325 } | 1325 } |
| 1326 |
| 1327 class KernelNativeMemberResolver extends NativeMemberResolverBase { |
| 1328 final KernelToElementMapImpl elementMap; |
| 1329 final NativeBasicData nativeBasicData; |
| 1330 final NativeDataBuilder nativeDataBuilder; |
| 1331 |
| 1332 KernelNativeMemberResolver( |
| 1333 this.elementMap, this.nativeBasicData, this.nativeDataBuilder); |
| 1334 |
| 1335 @override |
| 1336 ElementEnvironment get elementEnvironment => elementMap.elementEnvironment; |
| 1337 |
| 1338 @override |
| 1339 CommonElements get commonElements => elementMap.commonElements; |
| 1340 |
| 1341 @override |
| 1342 native.NativeBehavior computeNativeFieldStoreBehavior(KField field) { |
| 1343 ir.Field node = elementMap._memberList[field.memberIndex].node; |
| 1344 return elementMap.getNativeBehaviorForFieldStore(node); |
| 1345 } |
| 1346 |
| 1347 @override |
| 1348 native.NativeBehavior computeNativeFieldLoadBehavior(KField field, |
| 1349 {bool isJsInterop}) { |
| 1350 ir.Field node = elementMap._memberList[field.memberIndex].node; |
| 1351 return elementMap.getNativeBehaviorForFieldLoad(node, |
| 1352 isJsInterop: isJsInterop); |
| 1353 } |
| 1354 |
| 1355 @override |
| 1356 native.NativeBehavior computeNativeMethodBehavior(KFunction function, |
| 1357 {bool isJsInterop}) { |
| 1358 ir.Member node = elementMap._memberList[function.memberIndex].node; |
| 1359 return elementMap.getNativeBehaviorForMethod(node, |
| 1360 isJsInterop: isJsInterop); |
| 1361 } |
| 1362 |
| 1363 @override |
| 1364 bool isNativeMethod(KFunction function) { |
| 1365 ir.Member node = elementMap._memberList[function.memberIndex].node; |
| 1366 return node.isExternal && |
| 1367 !elementMap.isForeignLibrary(node.enclosingLibrary); |
| 1368 } |
| 1369 |
| 1370 @override |
| 1371 bool isJsInteropMember(MemberEntity element) { |
| 1372 // TODO(johnniwinther): Compute this. |
| 1373 return false; |
| 1374 } |
| 1375 } |
| OLD | NEW |