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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 /// True if a call to preserveMetadataMarker has been seen. This means that | 355 /// True if a call to preserveMetadataMarker has been seen. This means that |
356 /// metadata must be retained for dart:mirrors to work correctly. | 356 /// metadata must be retained for dart:mirrors to work correctly. |
357 bool mustRetainMetadata = false; | 357 bool mustRetainMetadata = false; |
358 | 358 |
359 /// True if any metadata has been retained. This is slightly different from | 359 /// True if any metadata has been retained. This is slightly different from |
360 /// [mustRetainMetadata] and tells us if any metadata was retained. For | 360 /// [mustRetainMetadata] and tells us if any metadata was retained. For |
361 /// example, if [mustRetainMetadata] is true but there is no metadata in the | 361 /// example, if [mustRetainMetadata] is true but there is no metadata in the |
362 /// program, this variable will stil be false. | 362 /// program, this variable will stil be false. |
363 bool hasRetainedMetadata = false; | 363 bool hasRetainedMetadata = false; |
364 | 364 |
365 /// True if a call to preserveUris has been seen and the preserve-uris flag | 365 /// True if a call to preserveUris has been seen. |
366 /// is set. | 366 bool mustRetainUris = false; |
367 bool mustPreserveUris = false; | |
368 | 367 |
369 /// True if a call to preserveLibraryNames has been seen. | 368 /// True if a call to preserveLibraryNames has been seen. |
370 bool mustRetainLibraryNames = false; | 369 bool mustRetainLibraryNames = false; |
371 | 370 |
372 /// True if a call to preserveNames has been seen. | 371 /// True if a call to preserveNames has been seen. |
373 bool mustPreserveNames = false; | 372 bool mustPreserveNames = false; |
374 | 373 |
375 /// True if a call to disableTreeShaking has been seen. | 374 /// True if a call to disableTreeShaking has been seen. |
376 bool isTreeShakingDisabled = false; | 375 bool isTreeShakingDisabled = false; |
377 | 376 |
(...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1562 void registerStaticUse(Element element, Enqueuer enqueuer) { | 1561 void registerStaticUse(Element element, Enqueuer enqueuer) { |
1563 if (element == disableTreeShakingMarker) { | 1562 if (element == disableTreeShakingMarker) { |
1564 compiler.disableTypeInferenceForMirrors = true; | 1563 compiler.disableTypeInferenceForMirrors = true; |
1565 isTreeShakingDisabled = true; | 1564 isTreeShakingDisabled = true; |
1566 typeVariableHandler.onTreeShakingDisabled(enqueuer); | 1565 typeVariableHandler.onTreeShakingDisabled(enqueuer); |
1567 } else if (element == preserveNamesMarker) { | 1566 } else if (element == preserveNamesMarker) { |
1568 mustPreserveNames = true; | 1567 mustPreserveNames = true; |
1569 } else if (element == preserveMetadataMarker) { | 1568 } else if (element == preserveMetadataMarker) { |
1570 mustRetainMetadata = true; | 1569 mustRetainMetadata = true; |
1571 } else if (element == preserveUrisMarker) { | 1570 } else if (element == preserveUrisMarker) { |
1572 if (compiler.preserveUris) mustPreserveUris = true; | 1571 mustRetainUris = true; |
1573 } else if (element == preserveLibraryNamesMarker) { | 1572 } else if (element == preserveLibraryNamesMarker) { |
1574 mustRetainLibraryNames = true; | 1573 mustRetainLibraryNames = true; |
1575 } else if (element == getIsolateAffinityTagMarker) { | 1574 } else if (element == getIsolateAffinityTagMarker) { |
1576 needToInitializeIsolateAffinityTag = true; | 1575 needToInitializeIsolateAffinityTag = true; |
1577 } else if (element.isDeferredLoaderGetter) { | 1576 } else if (element.isDeferredLoaderGetter) { |
1578 // TODO(sigurdm): Create a function registerLoadLibraryAccess. | 1577 // TODO(sigurdm): Create a function registerLoadLibraryAccess. |
1579 if (compiler.loadLibraryFunction == null) { | 1578 if (compiler.loadLibraryFunction == null) { |
1580 compiler.loadLibraryFunction = | 1579 compiler.loadLibraryFunction = |
1581 findHelper("_loadLibraryWrapper"); | 1580 findHelper("_loadLibraryWrapper"); |
1582 enqueueInResolution(compiler.loadLibraryFunction, | 1581 enqueueInResolution(compiler.loadLibraryFunction, |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2437 } | 2436 } |
2438 } | 2437 } |
2439 | 2438 |
2440 /// Records that [constant] is used by the element behind [registry]. | 2439 /// Records that [constant] is used by the element behind [registry]. |
2441 class Dependency { | 2440 class Dependency { |
2442 final ConstantValue constant; | 2441 final ConstantValue constant; |
2443 final Element annotatedElement; | 2442 final Element annotatedElement; |
2444 | 2443 |
2445 const Dependency(this.constant, this.annotatedElement); | 2444 const Dependency(this.constant, this.annotatedElement); |
2446 } | 2445 } |
OLD | NEW |