Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: pkg/compiler/lib/src/js_backend/mirrors_analysis.dart

Issue 2791263005: Split MirrorsData methods and MirrorsDataImpl data by element kind. (Closed)
Patch Set: Updated cf. comments. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/js_backend/mirrors_data.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/mirrors_analysis.dart
diff --git a/pkg/compiler/lib/src/js_backend/mirrors_analysis.dart b/pkg/compiler/lib/src/js_backend/mirrors_analysis.dart
index 26468e128a9ed80bc1f8dc1e164eb97996f92871..5f62b6e5998c5e58f58e827e099e296f02bfc9b5 100644
--- a/pkg/compiler/lib/src/js_backend/mirrors_analysis.dart
+++ b/pkg/compiler/lib/src/js_backend/mirrors_analysis.dart
@@ -73,14 +73,17 @@ class MirrorsResolutionAnalysisImpl implements MirrorsResolutionAnalysis {
});
}
- for (Element target in _mirrorsData.targetsUsed) {
- if (target == null) continue;
+ for (MemberElement target in _mirrorsData.membersInMirrorsUsedTargets) {
if (target.isField) {
staticFields.add(target);
- } else if (target.isLibrary || target.isClass) {
- addFieldsInContainer(target);
}
}
+ for (ClassElement target in _mirrorsData.classesInMirrorsUsedTargets) {
+ addFieldsInContainer(target);
+ }
+ for (LibraryElement target in _mirrorsData.librariesInMirrorsUsedTargets) {
+ addFieldsInContainer(target);
+ }
return staticFields;
}
@@ -107,7 +110,9 @@ class MirrorsResolutionAnalysisImpl implements MirrorsResolutionAnalysis {
if (_mirrorsData.isTreeShakingDisabled) {
enqueuer.applyImpact(_computeImpactForReflectiveElements(recentClasses,
enqueuer.processedClasses, _compiler.libraryLoader.libraries));
- } else if (!_mirrorsData.targetsUsed.isEmpty) {
+ } else if (_mirrorsData.membersInMirrorsUsedTargets.isNotEmpty ||
+ _mirrorsData.classesInMirrorsUsedTargets.isNotEmpty ||
+ _mirrorsData.librariesInMirrorsUsedTargets.isNotEmpty) {
// Add all static elements (not classes) that have been requested for
// reflection. If there is no mirror-usage these are probably not
// necessary, but the backend relies on them being resolved.
@@ -120,7 +125,8 @@ class MirrorsResolutionAnalysisImpl implements MirrorsResolutionAnalysis {
if (_mirrorsData.mustRetainMetadata) {
_reporter.log('Retaining metadata.');
- _compiler.libraryLoader.libraries.forEach(_mirrorsData.retainMetadataOf);
+ _compiler.libraryLoader.libraries
+ .forEach(_mirrorsData.retainMetadataOfLibrary);
if (!enqueuer.queueIsClosed) {
/// Register the constant value of [metadata] as live in resolution.
@@ -243,7 +249,8 @@ class MirrorsCodegenAnalysisImpl implements MirrorsCodegenAnalysis {
if (_mirrorsData.mustRetainMetadata) {
_reporter.log('Retaining metadata.');
- _compiler.libraryLoader.libraries.forEach(_mirrorsData.retainMetadataOf);
+ _compiler.libraryLoader.libraries
+ .forEach(_mirrorsData.retainMetadataOfLibrary);
for (Dependency dependency in _metadataConstants) {
_impactBuilder
@@ -383,7 +390,7 @@ class MirrorsHandler {
void _enqueueReflectiveSpecialClasses() {
Iterable<ClassElement> classes = _backend.classesRequiredForReflection;
for (ClassElement cls in classes) {
- if (_backend.mirrorsData.referencedFromMirrorSystem(cls)) {
+ if (_backend.mirrorsData.isClassReferencedFromMirrorSystem(cls)) {
_logEnqueueReflectiveAction(cls);
cls.ensureResolved(_resolution);
impactBuilder
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/js_backend/mirrors_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698