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 2978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2989 | 2989 |
2990 void registerBackendImpact( | 2990 void registerBackendImpact( |
2991 TransformedWorldImpact worldImpact, BackendImpact backendImpact) { | 2991 TransformedWorldImpact worldImpact, BackendImpact backendImpact) { |
2992 for (Element staticUse in backendImpact.staticUses) { | 2992 for (Element staticUse in backendImpact.staticUses) { |
2993 assert(staticUse != null); | 2993 assert(staticUse != null); |
2994 backend.registerBackendUse(staticUse); | 2994 backend.registerBackendUse(staticUse); |
2995 worldImpact.registerStaticUse( | 2995 worldImpact.registerStaticUse( |
2996 // TODO(johnniwinther): Store the correct use in impacts. | 2996 // TODO(johnniwinther): Store the correct use in impacts. |
2997 new StaticUse.foreignUse(staticUse)); | 2997 new StaticUse.foreignUse(staticUse)); |
2998 } | 2998 } |
| 2999 for (Selector selector in backendImpact.dynamicUses) { |
| 3000 assert(selector != null); |
| 3001 worldImpact.registerDynamicUse(new DynamicUse(selector, null)); |
| 3002 } |
2999 for (InterfaceType instantiatedType in backendImpact.instantiatedTypes) { | 3003 for (InterfaceType instantiatedType in backendImpact.instantiatedTypes) { |
3000 backend.registerBackendUse(instantiatedType.element); | 3004 backend.registerBackendUse(instantiatedType.element); |
3001 worldImpact.registerTypeUse(new TypeUse.instantiation(instantiatedType)); | 3005 worldImpact.registerTypeUse(new TypeUse.instantiation(instantiatedType)); |
3002 } | 3006 } |
3003 for (ClassElement cls in backendImpact.instantiatedClasses) { | 3007 for (ClassElement cls in backendImpact.instantiatedClasses) { |
3004 cls.ensureResolved(backend.resolution); | 3008 cls.ensureResolved(backend.resolution); |
3005 backend.registerBackendUse(cls); | 3009 backend.registerBackendUse(cls); |
3006 worldImpact.registerTypeUse(new TypeUse.instantiation(cls.rawType)); | 3010 worldImpact.registerTypeUse(new TypeUse.instantiation(cls.rawType)); |
3007 } | 3011 } |
3008 for (BackendImpact otherImpact in backendImpact.otherImpacts) { | 3012 for (BackendImpact otherImpact in backendImpact.otherImpacts) { |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3216 | 3220 |
3217 @override | 3221 @override |
3218 void onImpactUsed(ImpactUseCase impactUse) { | 3222 void onImpactUsed(ImpactUseCase impactUse) { |
3219 if (impactUse == DeferredLoadTask.IMPACT_USE && !supportSerialization) { | 3223 if (impactUse == DeferredLoadTask.IMPACT_USE && !supportSerialization) { |
3220 // TODO(johnniwinther): Allow emptying when serialization has been | 3224 // TODO(johnniwinther): Allow emptying when serialization has been |
3221 // performed. | 3225 // performed. |
3222 resolution.emptyCache(); | 3226 resolution.emptyCache(); |
3223 } | 3227 } |
3224 } | 3228 } |
3225 } | 3229 } |
OLD | NEW |