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 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
901 if (elements == null) return null; | 901 if (elements == null) return null; |
902 return elements | 902 return elements |
903 .where((element) => classesMixedIntoInterceptedClasses | 903 .where((element) => classesMixedIntoInterceptedClasses |
904 .contains(element.enclosingClass)) | 904 .contains(element.enclosingClass)) |
905 .toSet(); | 905 .toSet(); |
906 }); | 906 }); |
907 | 907 |
908 if (elements == null) return false; | 908 if (elements == null) return false; |
909 if (elements.isEmpty) return false; | 909 if (elements.isEmpty) return false; |
910 return elements.any((element) { | 910 return elements.any((element) { |
911 return selector.applies(element, compiler.closedWorld) && | 911 return selector.applies(element, this) && |
912 (mask == null || | 912 (mask == null || |
913 mask.canHit(element, selector, compiler.closedWorld)); | 913 mask.canHit(element, selector, compiler.closedWorld)); |
914 }); | 914 }); |
915 } | 915 } |
916 | 916 |
917 /// True if the given class is an internal class used for type inference | 917 /// True if the given class is an internal class used for type inference |
918 /// and never exists at runtime. | 918 /// and never exists at runtime. |
919 bool isCompileTimeOnlyClass(ClassElement class_) { | 919 bool isCompileTimeOnlyClass(ClassElement class_) { |
920 return class_ == helpers.jsPositiveIntClass || | 920 return class_ == helpers.jsPositiveIntClass || |
921 class_ == helpers.jsUInt32Class || | 921 class_ == helpers.jsUInt32Class || |
(...skipping 1942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2864 if (backend.compiler.options.enableTypeAssertions) { | 2864 if (backend.compiler.options.enableTypeAssertions) { |
2865 onIsCheck(type, transformed); | 2865 onIsCheck(type, transformed); |
2866 } | 2866 } |
2867 break; | 2867 break; |
2868 case TypeUseKind.CATCH_TYPE: | 2868 case TypeUseKind.CATCH_TYPE: |
2869 onIsCheck(type, transformed); | 2869 onIsCheck(type, transformed); |
2870 break; | 2870 break; |
2871 case TypeUseKind.TYPE_LITERAL: | 2871 case TypeUseKind.TYPE_LITERAL: |
2872 backend.customElementsAnalysis.registerTypeLiteral(type); | 2872 backend.customElementsAnalysis.registerTypeLiteral(type); |
2873 if (type.isTypedef) { | 2873 if (type.isTypedef) { |
2874 backend.compiler.openWorld.allTypedefs.add(type.element); | 2874 backend.compiler.openWorld.registerTypedef(type.element); |
2875 } | 2875 } |
2876 if (type.isTypeVariable && type is! MethodTypeVariableType) { | 2876 if (type.isTypeVariable && type is! MethodTypeVariableType) { |
2877 // GENERIC_METHODS: The `is!` test above filters away method type | 2877 // GENERIC_METHODS: The `is!` test above filters away method type |
2878 // variables, because they have the value `dynamic` with the | 2878 // variables, because they have the value `dynamic` with the |
2879 // incomplete support for generic methods offered with | 2879 // incomplete support for generic methods offered with |
2880 // '--generic-method-syntax'. This must be revised in order to | 2880 // '--generic-method-syntax'. This must be revised in order to |
2881 // support generic methods fully. | 2881 // support generic methods fully. |
2882 ClassElement cls = type.element.enclosingClass; | 2882 ClassElement cls = type.element.enclosingClass; |
2883 backend.rti.registerClassUsingTypeVariableExpression(cls); | 2883 backend.rti.registerClassUsingTypeVariableExpression(cls); |
2884 registerBackendImpact(transformed, impacts.typeVariableExpression); | 2884 registerBackendImpact(transformed, impacts.typeVariableExpression); |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3197 | 3197 |
3198 @override | 3198 @override |
3199 void onImpactUsed(ImpactUseCase impactUse) { | 3199 void onImpactUsed(ImpactUseCase impactUse) { |
3200 if (impactUse == DeferredLoadTask.IMPACT_USE && !supportSerialization) { | 3200 if (impactUse == DeferredLoadTask.IMPACT_USE && !supportSerialization) { |
3201 // TODO(johnniwinther): Allow emptying when serialization has been | 3201 // TODO(johnniwinther): Allow emptying when serialization has been |
3202 // performed. | 3202 // performed. |
3203 resolution.emptyCache(); | 3203 resolution.emptyCache(); |
3204 } | 3204 } |
3205 } | 3205 } |
3206 } | 3206 } |
OLD | NEW |