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 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1756 preserveUrisMarker = find(library, 'preserveUris'); | 1756 preserveUrisMarker = find(library, 'preserveUris'); |
1757 preserveLibraryNamesMarker = find(library, 'preserveLibraryNames'); | 1757 preserveLibraryNamesMarker = find(library, 'preserveLibraryNames'); |
1758 } else if (uri == DART_JS_NAMES) { | 1758 } else if (uri == DART_JS_NAMES) { |
1759 preserveNamesMarker = find(library, 'preserveNames'); | 1759 preserveNamesMarker = find(library, 'preserveNames'); |
1760 } else if (uri == DART_HTML) { | 1760 } else if (uri == DART_HTML) { |
1761 htmlLibraryIsLoaded = true; | 1761 htmlLibraryIsLoaded = true; |
1762 } | 1762 } |
1763 }); | 1763 }); |
1764 } | 1764 } |
1765 | 1765 |
1766 Future onLibrariesLoaded(Map<Uri, LibraryElement> loadedLibraries) { | 1766 Future onLibrariesLoaded(LoadedLibraries loadedLibraries) { |
1767 if (!loadedLibraries.containsKey(Compiler.DART_CORE)) { | 1767 if (!loadedLibraries.containsLibrary(Compiler.DART_CORE)) { |
1768 return new Future.value(); | 1768 return new Future.value(); |
1769 } | 1769 } |
1770 | 1770 |
1771 assert(loadedLibraries.containsKey(Compiler.DART_CORE)); | 1771 assert(loadedLibraries.containsLibrary(Compiler.DART_CORE)); |
1772 assert(loadedLibraries.containsKey(DART_INTERCEPTORS)); | 1772 assert(loadedLibraries.containsLibrary(DART_INTERCEPTORS)); |
1773 assert(loadedLibraries.containsKey(DART_JS_HELPER)); | 1773 assert(loadedLibraries.containsLibrary(DART_JS_HELPER)); |
1774 | 1774 |
1775 if (jsInvocationMirrorClass != null) { | 1775 if (jsInvocationMirrorClass != null) { |
1776 jsInvocationMirrorClass.ensureResolved(compiler); | 1776 jsInvocationMirrorClass.ensureResolved(compiler); |
1777 invokeOnMethod = jsInvocationMirrorClass.lookupLocalMember(INVOKE_ON); | 1777 invokeOnMethod = jsInvocationMirrorClass.lookupLocalMember(INVOKE_ON); |
1778 } | 1778 } |
1779 | 1779 |
1780 // [LinkedHashMap] is reexported from dart:collection and can therefore not | 1780 // [LinkedHashMap] is reexported from dart:collection and can therefore not |
1781 // be loaded from dart:core in [onLibraryScanned]. | 1781 // be loaded from dart:core in [onLibraryScanned]. |
1782 mapLiteralClass = compiler.coreLibrary.find('LinkedHashMap'); | 1782 mapLiteralClass = compiler.coreLibrary.find('LinkedHashMap'); |
1783 assert(invariant(compiler.coreLibrary, mapLiteralClass != null, | 1783 assert(invariant(compiler.coreLibrary, mapLiteralClass != null, |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2461 } | 2461 } |
2462 } | 2462 } |
2463 | 2463 |
2464 /// Records that [constant] is used by the element behind [registry]. | 2464 /// Records that [constant] is used by the element behind [registry]. |
2465 class Dependency { | 2465 class Dependency { |
2466 final ConstantValue constant; | 2466 final ConstantValue constant; |
2467 final Element annotatedElement; | 2467 final Element annotatedElement; |
2468 | 2468 |
2469 const Dependency(this.constant, this.annotatedElement); | 2469 const Dependency(this.constant, this.annotatedElement); |
2470 } | 2470 } |
OLD | NEW |