| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import '../closure.dart'; | 5 import '../closure.dart'; |
| 6 import '../common.dart'; | 6 import '../common.dart'; |
| 7 import '../common_elements.dart'; | 7 import '../common_elements.dart'; |
| 8 import '../compiler.dart'; | 8 import '../compiler.dart'; |
| 9 import '../constants/values.dart'; | 9 import '../constants/values.dart'; |
| 10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 /// element must be retained. | 200 /// element must be retained. |
| 201 final Set<ClassEntity> metaTargetsUsed = new Set<ClassEntity>(); | 201 final Set<ClassEntity> metaTargetsUsed = new Set<ClassEntity>(); |
| 202 | 202 |
| 203 // TODO(johnniwinther): Avoid the need for this. | 203 // TODO(johnniwinther): Avoid the need for this. |
| 204 final Compiler _compiler; | 204 final Compiler _compiler; |
| 205 | 205 |
| 206 final CompilerOptions _options; | 206 final CompilerOptions _options; |
| 207 | 207 |
| 208 final CommonElements _commonElements; | 208 final CommonElements _commonElements; |
| 209 | 209 |
| 210 final JavaScriptConstantCompiler _constants; | 210 MirrorsDataImpl(this._compiler, this._options, this._commonElements); |
| 211 | 211 |
| 212 MirrorsDataImpl( | 212 JavaScriptConstantCompiler get _constants => _compiler.backend.constants; |
| 213 this._compiler, this._options, this._commonElements, this._constants); | |
| 214 | 213 |
| 215 void registerUsedMember(MemberElement member) { | 214 void registerUsedMember(MemberElement member) { |
| 216 if (member == _commonElements.disableTreeShakingMarker) { | 215 if (member == _commonElements.disableTreeShakingMarker) { |
| 217 isTreeShakingDisabled = true; | 216 isTreeShakingDisabled = true; |
| 218 } else if (member == _commonElements.preserveNamesMarker) { | 217 } else if (member == _commonElements.preserveNamesMarker) { |
| 219 mustPreserveNames = true; | 218 mustPreserveNames = true; |
| 220 } else if (member == _commonElements.preserveMetadataMarker) { | 219 } else if (member == _commonElements.preserveMetadataMarker) { |
| 221 mustRetainMetadata = true; | 220 mustRetainMetadata = true; |
| 222 } else if (member == _commonElements.preserveUrisMarker) { | 221 } else if (member == _commonElements.preserveUrisMarker) { |
| 223 if (_options.preserveUris) mustPreserveUris = true; | 222 if (_options.preserveUris) mustPreserveUris = true; |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 } | 689 } |
| 691 | 690 |
| 692 /// Called when `const Symbol(name)` is seen. | 691 /// Called when `const Symbol(name)` is seen. |
| 693 void registerConstSymbol(String name) { | 692 void registerConstSymbol(String name) { |
| 694 symbolsUsed.add(name); | 693 symbolsUsed.add(name); |
| 695 if (name.endsWith('=')) { | 694 if (name.endsWith('=')) { |
| 696 symbolsUsed.add(name.substring(0, name.length - 1)); | 695 symbolsUsed.add(name.substring(0, name.length - 1)); |
| 697 } | 696 } |
| 698 } | 697 } |
| 699 } | 698 } |
| OLD | NEW |