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 2366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2377 registerBackendUse(e); | 2377 registerBackendUse(e); |
2378 enqueuer.addToWorkList(e); | 2378 enqueuer.addToWorkList(e); |
2379 } | 2379 } |
2380 } | 2380 } |
2381 | 2381 |
2382 if (!enqueuer.isResolutionQueue && preMirrorsMethodCount == 0) { | 2382 if (!enqueuer.isResolutionQueue && preMirrorsMethodCount == 0) { |
2383 preMirrorsMethodCount = generatedCode.length; | 2383 preMirrorsMethodCount = generatedCode.length; |
2384 } | 2384 } |
2385 | 2385 |
2386 if (isTreeShakingDisabled) { | 2386 if (isTreeShakingDisabled) { |
2387 mirrorsAnalysis.enqueueReflectiveElements( | 2387 enqueuer.applyImpact( |
2388 enqueuer, recentClasses, compiler.libraryLoader.libraries); | 2388 compiler.impactStrategy, |
| 2389 mirrorsAnalysis.computeImpactForReflectiveElements(recentClasses, |
| 2390 enqueuer.processedClasses, compiler.libraryLoader.libraries, |
| 2391 forResolution: enqueuer.isResolutionQueue)); |
2389 } else if (!targetsUsed.isEmpty && enqueuer.isResolutionQueue) { | 2392 } else if (!targetsUsed.isEmpty && enqueuer.isResolutionQueue) { |
2390 // Add all static elements (not classes) that have been requested for | 2393 // Add all static elements (not classes) that have been requested for |
2391 // reflection. If there is no mirror-usage these are probably not | 2394 // reflection. If there is no mirror-usage these are probably not |
2392 // necessary, but the backend relies on them being resolved. | 2395 // necessary, but the backend relies on them being resolved. |
2393 mirrorsAnalysis.enqueueReflectiveStaticFields( | 2396 enqueuer.applyImpact( |
2394 enqueuer, _findStaticFieldTargets()); | 2397 compiler.impactStrategy, |
| 2398 mirrorsAnalysis.computeImpactForReflectiveStaticFields( |
| 2399 _findStaticFieldTargets(), |
| 2400 forResolution: enqueuer.isResolutionQueue)); |
2395 } | 2401 } |
2396 | 2402 |
2397 if (mustPreserveNames) reporter.log('Preserving names.'); | 2403 if (mustPreserveNames) reporter.log('Preserving names.'); |
2398 | 2404 |
2399 if (mustRetainMetadata) { | 2405 if (mustRetainMetadata) { |
2400 reporter.log('Retaining metadata.'); | 2406 reporter.log('Retaining metadata.'); |
2401 | 2407 |
2402 compiler.libraryLoader.libraries.forEach(retainMetadataOf); | 2408 compiler.libraryLoader.libraries.forEach(retainMetadataOf); |
2403 | 2409 |
2404 StagedWorldImpactBuilder impactBuilder = enqueuer.isResolutionQueue | 2410 StagedWorldImpactBuilder impactBuilder = enqueuer.isResolutionQueue |
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3276 ClassElement get mapImplementation => helpers.mapLiteralClass; | 3282 ClassElement get mapImplementation => helpers.mapLiteralClass; |
3277 ClassElement get constMapImplementation => helpers.constMapLiteralClass; | 3283 ClassElement get constMapImplementation => helpers.constMapLiteralClass; |
3278 ClassElement get typeImplementation => helpers.typeLiteralClass; | 3284 ClassElement get typeImplementation => helpers.typeLiteralClass; |
3279 ClassElement get boolImplementation => helpers.jsBoolClass; | 3285 ClassElement get boolImplementation => helpers.jsBoolClass; |
3280 ClassElement get nullImplementation => helpers.jsNullClass; | 3286 ClassElement get nullImplementation => helpers.jsNullClass; |
3281 ClassElement get syncStarIterableImplementation => helpers.syncStarIterable; | 3287 ClassElement get syncStarIterableImplementation => helpers.syncStarIterable; |
3282 ClassElement get asyncFutureImplementation => helpers.futureImplementation; | 3288 ClassElement get asyncFutureImplementation => helpers.futureImplementation; |
3283 ClassElement get asyncStarStreamImplementation => helpers.controllerStream; | 3289 ClassElement get asyncStarStreamImplementation => helpers.controllerStream; |
3284 ClassElement get functionImplementation => helpers.coreClasses.functionClass; | 3290 ClassElement get functionImplementation => helpers.coreClasses.functionClass; |
3285 } | 3291 } |
OLD | NEW |