| 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 const bool USE_CPS_IR = const bool.fromEnvironment("USE_CPS_IR"); | 9 const bool USE_CPS_IR = const bool.fromEnvironment("USE_CPS_IR"); |
| 10 | 10 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 static final Uri DART_INTERCEPTORS = | 66 static final Uri DART_INTERCEPTORS = |
| 67 new Uri(scheme: 'dart', path: '_interceptors'); | 67 new Uri(scheme: 'dart', path: '_interceptors'); |
| 68 static final Uri DART_INTERNAL = | 68 static final Uri DART_INTERNAL = |
| 69 new Uri(scheme: 'dart', path: '_internal'); | 69 new Uri(scheme: 'dart', path: '_internal'); |
| 70 static final Uri DART_FOREIGN_HELPER = | 70 static final Uri DART_FOREIGN_HELPER = |
| 71 new Uri(scheme: 'dart', path: '_foreign_helper'); | 71 new Uri(scheme: 'dart', path: '_foreign_helper'); |
| 72 static final Uri DART_JS_MIRRORS = | 72 static final Uri DART_JS_MIRRORS = |
| 73 new Uri(scheme: 'dart', path: '_js_mirrors'); | 73 new Uri(scheme: 'dart', path: '_js_mirrors'); |
| 74 static final Uri DART_JS_NAMES = | 74 static final Uri DART_JS_NAMES = |
| 75 new Uri(scheme: 'dart', path: '_js_names'); | 75 new Uri(scheme: 'dart', path: '_js_names'); |
| 76 static final Uri DART_EMBEDDED_NAMES = |
| 77 new Uri(scheme: 'dart', path: '_js_embedded_names'); |
| 76 static final Uri DART_ISOLATE_HELPER = | 78 static final Uri DART_ISOLATE_HELPER = |
| 77 new Uri(scheme: 'dart', path: '_isolate_helper'); | 79 new Uri(scheme: 'dart', path: '_isolate_helper'); |
| 78 static final Uri DART_HTML = | 80 static final Uri DART_HTML = |
| 79 new Uri(scheme: 'dart', path: 'html'); | 81 new Uri(scheme: 'dart', path: 'html'); |
| 80 | 82 |
| 81 static const String INVOKE_ON = '_getCachedInvocation'; | 83 static const String INVOKE_ON = '_getCachedInvocation'; |
| 82 static const String START_ROOT_ISOLATE = 'startRootIsolate'; | 84 static const String START_ROOT_ISOLATE = 'startRootIsolate'; |
| 83 | 85 |
| 84 | 86 |
| 85 /// The list of functions for classes in the [internalLibrary] that we want | 87 /// The list of functions for classes in the [internalLibrary] that we want |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 /// dart:mirrors has been loaded. | 358 /// dart:mirrors has been loaded. |
| 357 FunctionElement preserveUrisMarker; | 359 FunctionElement preserveUrisMarker; |
| 358 | 360 |
| 359 /// Holds the method "preserveLibraryNames" in js_mirrors when | 361 /// Holds the method "preserveLibraryNames" in js_mirrors when |
| 360 /// dart:mirrors has been loaded. | 362 /// dart:mirrors has been loaded. |
| 361 FunctionElement preserveLibraryNamesMarker; | 363 FunctionElement preserveLibraryNamesMarker; |
| 362 | 364 |
| 363 /// Holds the method "requiresPreamble" in _js_helper. | 365 /// Holds the method "requiresPreamble" in _js_helper. |
| 364 FunctionElement requiresPreambleMarker; | 366 FunctionElement requiresPreambleMarker; |
| 365 | 367 |
| 368 /// Holds the class for the [JsGetName] enum. |
| 369 EnumClassElement jsGetNameEnum; |
| 370 |
| 366 /// True if a call to preserveMetadataMarker has been seen. This means that | 371 /// True if a call to preserveMetadataMarker has been seen. This means that |
| 367 /// metadata must be retained for dart:mirrors to work correctly. | 372 /// metadata must be retained for dart:mirrors to work correctly. |
| 368 bool mustRetainMetadata = false; | 373 bool mustRetainMetadata = false; |
| 369 | 374 |
| 370 /// True if any metadata has been retained. This is slightly different from | 375 /// True if any metadata has been retained. This is slightly different from |
| 371 /// [mustRetainMetadata] and tells us if any metadata was retained. For | 376 /// [mustRetainMetadata] and tells us if any metadata was retained. For |
| 372 /// example, if [mustRetainMetadata] is true but there is no metadata in the | 377 /// example, if [mustRetainMetadata] is true but there is no metadata in the |
| 373 /// program, this variable will stil be false. | 378 /// program, this variable will stil be false. |
| 374 bool hasRetainedMetadata = false; | 379 bool hasRetainedMetadata = false; |
| 375 | 380 |
| (...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1868 getIsolateAffinityTagMarker = findMethod('getIsolateAffinityTag'); | 1873 getIsolateAffinityTagMarker = findMethod('getIsolateAffinityTag'); |
| 1869 | 1874 |
| 1870 requiresPreambleMarker = findMethod('requiresPreamble'); | 1875 requiresPreambleMarker = findMethod('requiresPreamble'); |
| 1871 } else if (uri == DART_JS_MIRRORS) { | 1876 } else if (uri == DART_JS_MIRRORS) { |
| 1872 disableTreeShakingMarker = find(library, 'disableTreeShaking'); | 1877 disableTreeShakingMarker = find(library, 'disableTreeShaking'); |
| 1873 preserveMetadataMarker = find(library, 'preserveMetadata'); | 1878 preserveMetadataMarker = find(library, 'preserveMetadata'); |
| 1874 preserveUrisMarker = find(library, 'preserveUris'); | 1879 preserveUrisMarker = find(library, 'preserveUris'); |
| 1875 preserveLibraryNamesMarker = find(library, 'preserveLibraryNames'); | 1880 preserveLibraryNamesMarker = find(library, 'preserveLibraryNames'); |
| 1876 } else if (uri == DART_JS_NAMES) { | 1881 } else if (uri == DART_JS_NAMES) { |
| 1877 preserveNamesMarker = find(library, 'preserveNames'); | 1882 preserveNamesMarker = find(library, 'preserveNames'); |
| 1883 } else if (uri == DART_EMBEDDED_NAMES) { |
| 1884 jsGetNameEnum = find(library, 'JsGetName'); |
| 1878 } else if (uri == DART_HTML) { | 1885 } else if (uri == DART_HTML) { |
| 1879 htmlLibraryIsLoaded = true; | 1886 htmlLibraryIsLoaded = true; |
| 1880 } | 1887 } |
| 1881 annotations.onLibraryScanned(library); | 1888 annotations.onLibraryScanned(library); |
| 1882 }); | 1889 }); |
| 1883 } | 1890 } |
| 1884 | 1891 |
| 1885 Future onLibrariesLoaded(LoadedLibraries loadedLibraries) { | 1892 Future onLibrariesLoaded(LoadedLibraries loadedLibraries) { |
| 1886 if (!loadedLibraries.containsLibrary(Compiler.DART_CORE)) { | 1893 if (!loadedLibraries.containsLibrary(Compiler.DART_CORE)) { |
| 1887 return new Future.value(); | 1894 return new Future.value(); |
| (...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2698 } | 2705 } |
| 2699 } | 2706 } |
| 2700 | 2707 |
| 2701 /// Records that [constant] is used by the element behind [registry]. | 2708 /// Records that [constant] is used by the element behind [registry]. |
| 2702 class Dependency { | 2709 class Dependency { |
| 2703 final ConstantValue constant; | 2710 final ConstantValue constant; |
| 2704 final Element annotatedElement; | 2711 final Element annotatedElement; |
| 2705 | 2712 |
| 2706 const Dependency(this.constant, this.annotatedElement); | 2713 const Dependency(this.constant, this.annotatedElement); |
| 2707 } | 2714 } |
| OLD | NEW |