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

Side by Side Diff: pkg/compiler/lib/src/js_backend/mirrors_analysis.dart

Issue 2797443008: Reapply "Add "load from .dill" file capability and run a white-box test."" (Closed)
Patch Set: take two 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 unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/dump_info.dart ('k') | pkg/compiler/lib/src/kernel/kernel.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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.mirrors_handler; 5 library dart2js.mirrors_handler;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/resolution.dart'; 8 import '../common/resolution.dart';
9 import '../compiler.dart'; 9 import '../compiler.dart';
10 import '../constants/values.dart'; 10 import '../constants/values.dart';
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // necessary, but the backend relies on them being resolved. 113 // necessary, but the backend relies on them being resolved.
114 enqueuer.applyImpact( 114 enqueuer.applyImpact(
115 _computeImpactForReflectiveStaticFields(_findStaticFieldTargets())); 115 _computeImpactForReflectiveStaticFields(_findStaticFieldTargets()));
116 } 116 }
117 117
118 if (_mirrorsData.mustPreserveNames) _reporter.log('Preserving names.'); 118 if (_mirrorsData.mustPreserveNames) _reporter.log('Preserving names.');
119 119
120 if (_mirrorsData.mustRetainMetadata) { 120 if (_mirrorsData.mustRetainMetadata) {
121 _reporter.log('Retaining metadata.'); 121 _reporter.log('Retaining metadata.');
122 122
123 _compiler.libraryLoader.libraries.forEach(_mirrorsData.retainMetadataOf); 123 (_compiler.libraryLoader.libraries as Iterable<LibraryElement>)
124 .forEach(_mirrorsData.retainMetadataOf);
124 125
125 if (!enqueuer.queueIsClosed) { 126 if (!enqueuer.queueIsClosed) {
126 /// Register the constant value of [metadata] as live in resolution. 127 /// Register the constant value of [metadata] as live in resolution.
127 void registerMetadataConstant(MetadataAnnotation metadata) { 128 void registerMetadataConstant(MetadataAnnotation metadata) {
128 ConstantValue constant = 129 ConstantValue constant =
129 _constants.getConstantValueForMetadata(metadata); 130 _constants.getConstantValueForMetadata(metadata);
130 Dependency dependency = 131 Dependency dependency =
131 new Dependency(constant, metadata.annotatedElement); 132 new Dependency(constant, metadata.annotatedElement);
132 _metadataConstants.add(dependency); 133 _metadataConstants.add(dependency);
133 _impactBuilder.registerConstantUse(new ConstantUse.mirrors(constant)); 134 _impactBuilder.registerConstantUse(new ConstantUse.mirrors(constant));
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 if (_mirrorsData.isTreeShakingDisabled) { 237 if (_mirrorsData.isTreeShakingDisabled) {
237 enqueuer.applyImpact(_computeImpactForReflectiveElements(recentClasses, 238 enqueuer.applyImpact(_computeImpactForReflectiveElements(recentClasses,
238 enqueuer.processedClasses, _compiler.libraryLoader.libraries)); 239 enqueuer.processedClasses, _compiler.libraryLoader.libraries));
239 } 240 }
240 241
241 if (_mirrorsData.mustPreserveNames) _reporter.log('Preserving names.'); 242 if (_mirrorsData.mustPreserveNames) _reporter.log('Preserving names.');
242 243
243 if (_mirrorsData.mustRetainMetadata) { 244 if (_mirrorsData.mustRetainMetadata) {
244 _reporter.log('Retaining metadata.'); 245 _reporter.log('Retaining metadata.');
245 246
246 _compiler.libraryLoader.libraries.forEach(_mirrorsData.retainMetadataOf); 247 (_compiler.libraryLoader.libraries as Iterable<LibraryElement>)
248 .forEach(_mirrorsData.retainMetadataOf);
247 249
248 for (Dependency dependency in _metadataConstants) { 250 for (Dependency dependency in _metadataConstants) {
249 _impactBuilder 251 _impactBuilder
250 .registerConstantUse(new ConstantUse.mirrors(dependency.constant)); 252 .registerConstantUse(new ConstantUse.mirrors(dependency.constant));
251 } 253 }
252 _metadataConstants.clear(); 254 _metadataConstants.clear();
253 enqueuer.applyImpact(_impactBuilder.flush()); 255 enqueuer.applyImpact(_impactBuilder.flush());
254 } 256 }
255 } 257 }
256 } 258 }
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 470
469 /// Records that [constant] is used by the element behind [registry]. 471 /// Records that [constant] is used by the element behind [registry].
470 class Dependency { 472 class Dependency {
471 final ConstantValue constant; 473 final ConstantValue constant;
472 final Element annotatedElement; 474 final Element annotatedElement;
473 475
474 const Dependency(this.constant, this.annotatedElement); 476 const Dependency(this.constant, this.annotatedElement);
475 477
476 String toString() => '$annotatedElement:${constant.toStructuredText()}'; 478 String toString() => '$annotatedElement:${constant.toStructuredText()}';
477 } 479 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/dump_info.dart ('k') | pkg/compiler/lib/src/kernel/kernel.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698