Index: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
index d157b569549862ab23235d589406930f0d2b206e..5376e1ee10b7bf178b969a24877c8e4a76304eb7 100644 |
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
@@ -1193,13 +1193,7 @@ class JavaScriptBackend extends Backend { |
emitter.assembleProgram(); |
int totalMethodCount = generatedCode.length; |
if (totalMethodCount != preMirrorsMethodCount) { |
- int mirrorCount = totalMethodCount - preMirrorsMethodCount; |
- double percentage = (mirrorCount / totalMethodCount) * 100; |
- compiler.reportHint( |
- compiler.mainApp, MessageKind.MIRROR_BLOAT, |
- {'count': mirrorCount, |
- 'total': totalMethodCount, |
- 'percentage': percentage.round()}); |
+ bool reportedHint = false; |
for (LibraryElement library in compiler.libraries.values) { |
if (library.isInternalLibrary) continue; |
for (LibraryTag tag in library.tags) { |
@@ -1207,6 +1201,16 @@ class JavaScriptBackend extends Backend { |
if (importTag == null) continue; |
LibraryElement importedLibrary = library.getLibraryFromTag(tag); |
if (importedLibrary != compiler.mirrorsLibrary) continue; |
+ if (!reportedHint) { |
+ reportedHint = true; |
+ int mirrorCount = totalMethodCount - preMirrorsMethodCount; |
+ double percentage = (mirrorCount / totalMethodCount) * 100; |
+ compiler.reportHint( |
+ compiler.mainApp, MessageKind.MIRROR_BLOAT, |
+ {'count': mirrorCount, |
+ 'total': totalMethodCount, |
+ 'percentage': percentage.round()}); |
+ } |
MessageKind kind = |
compiler.mirrorUsageAnalyzerTask.hasMirrorUsage(library) |
? MessageKind.MIRROR_IMPORT |