| 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 part of js_backend; | 5 part of js_backend; |
| 6 | 6 |
| 7 const VERBOSE_OPTIMIZER_HINTS = false; | 7 const VERBOSE_OPTIMIZER_HINTS = false; |
| 8 | 8 |
| 9 class JavaScriptItemCompilationContext extends ItemCompilationContext { | 9 class JavaScriptItemCompilationContext extends ItemCompilationContext { |
| 10 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); | 10 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); |
| (...skipping 1502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1513 if (totalMethodCount != preMirrorsMethodCount) { | 1513 if (totalMethodCount != preMirrorsMethodCount) { |
| 1514 int mirrorCount = totalMethodCount - preMirrorsMethodCount; | 1514 int mirrorCount = totalMethodCount - preMirrorsMethodCount; |
| 1515 double percentage = (mirrorCount / totalMethodCount) * 100; | 1515 double percentage = (mirrorCount / totalMethodCount) * 100; |
| 1516 compiler.reportHint( | 1516 compiler.reportHint( |
| 1517 compiler.mainApp, MessageKind.MIRROR_BLOAT, | 1517 compiler.mainApp, MessageKind.MIRROR_BLOAT, |
| 1518 {'count': mirrorCount, | 1518 {'count': mirrorCount, |
| 1519 'total': totalMethodCount, | 1519 'total': totalMethodCount, |
| 1520 'percentage': percentage.round()}); | 1520 'percentage': percentage.round()}); |
| 1521 for (LibraryElement library in compiler.libraryLoader.libraries) { | 1521 for (LibraryElement library in compiler.libraryLoader.libraries) { |
| 1522 if (library.isInternalLibrary) continue; | 1522 if (library.isInternalLibrary) continue; |
| 1523 for (LibraryTag tag in library.tags) { | 1523 for (ImportElement import in library.imports) { |
| 1524 Import importTag = tag.asImport(); | 1524 LibraryElement importedLibrary = import.importedLibrary; |
| 1525 if (importTag == null) continue; | |
| 1526 LibraryElement importedLibrary = library.getLibraryFromTag(tag); | |
| 1527 if (importedLibrary != compiler.mirrorsLibrary) continue; | 1525 if (importedLibrary != compiler.mirrorsLibrary) continue; |
| 1528 MessageKind kind = | 1526 MessageKind kind = |
| 1529 compiler.mirrorUsageAnalyzerTask.hasMirrorUsage(library) | 1527 compiler.mirrorUsageAnalyzerTask.hasMirrorUsage(library) |
| 1530 ? MessageKind.MIRROR_IMPORT | 1528 ? MessageKind.MIRROR_IMPORT |
| 1531 : MessageKind.MIRROR_IMPORT_NO_USAGE; | 1529 : MessageKind.MIRROR_IMPORT_NO_USAGE; |
| 1532 compiler.withCurrentElement(library, () { | 1530 compiler.withCurrentElement(library, () { |
| 1533 compiler.reportInfo(importTag, kind); | 1531 compiler.reportInfo(import, kind); |
| 1534 }); | 1532 }); |
| 1535 } | 1533 } |
| 1536 } | 1534 } |
| 1537 } | 1535 } |
| 1538 return programSize; | 1536 return programSize; |
| 1539 } | 1537 } |
| 1540 | 1538 |
| 1541 Element getDartClass(Element element) { | 1539 Element getDartClass(Element element) { |
| 1542 for (ClassElement dartClass in implementationClasses.keys) { | 1540 for (ClassElement dartClass in implementationClasses.keys) { |
| 1543 if (element == implementationClasses[dartClass]) { | 1541 if (element == implementationClasses[dartClass]) { |
| (...skipping 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3157 } | 3155 } |
| 3158 } | 3156 } |
| 3159 | 3157 |
| 3160 /// Records that [constant] is used by the element behind [registry]. | 3158 /// Records that [constant] is used by the element behind [registry]. |
| 3161 class Dependency { | 3159 class Dependency { |
| 3162 final ConstantValue constant; | 3160 final ConstantValue constant; |
| 3163 final Element annotatedElement; | 3161 final Element annotatedElement; |
| 3164 | 3162 |
| 3165 const Dependency(this.constant, this.annotatedElement); | 3163 const Dependency(this.constant, this.annotatedElement); |
| 3166 } | 3164 } |
| OLD | NEW |