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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 /// Sets of elements that are needed by reflection. Computed using | 333 /// Sets of elements that are needed by reflection. Computed using |
334 /// [computeMembersNeededForReflection] on first use. | 334 /// [computeMembersNeededForReflection] on first use. |
335 Set<ClassElement> _classesNeededForReflection; | 335 Set<ClassElement> _classesNeededForReflection; |
336 Set<TypedefElement> _typedefsNeededForReflection; | 336 Set<TypedefElement> _typedefsNeededForReflection; |
337 Set<MemberElement> _membersNeededForReflection; | 337 Set<MemberElement> _membersNeededForReflection; |
338 Set<LocalFunctionElement> _closuresNeededForReflection; | 338 Set<LocalFunctionElement> _closuresNeededForReflection; |
339 | 339 |
340 /// Called by [MirrorUsageAnalyzerTask] after it has merged all @MirrorsUsed | 340 /// Called by [MirrorUsageAnalyzerTask] after it has merged all @MirrorsUsed |
341 /// annotations. The arguments corresponds to the unions of the corresponding | 341 /// annotations. The arguments corresponds to the unions of the corresponding |
342 /// fields of the annotations. | 342 /// fields of the annotations. |
343 // TODO(johnniwinther): Change type of [metaTargets] to `Set<ClassEntity>`. | 343 // TODO(redemption): Change type of [metaTargets] to `Set<ClassEntity>`. |
344 void registerMirrorUsage( | 344 void registerMirrorUsage( |
345 Set<String> symbols, Set<Element> targets, Set<Element> metaTargets) { | 345 Set<String> symbols, Set<Element> targets, Set<Element> metaTargets) { |
346 if (symbols == null && targets == null && metaTargets == null) { | 346 if (symbols == null && targets == null && metaTargets == null) { |
347 // The user didn't specify anything, or there are imports of | 347 // The user didn't specify anything, or there are imports of |
348 // 'dart:mirrors' without @MirrorsUsed. | 348 // 'dart:mirrors' without @MirrorsUsed. |
349 hasInsufficientMirrorsUsed = true; | 349 hasInsufficientMirrorsUsed = true; |
350 return; | 350 return; |
351 } | 351 } |
352 if (symbols != null) symbolsUsed.addAll(symbols); | 352 if (symbols != null) symbolsUsed.addAll(symbols); |
353 if (targets != null) { | 353 if (targets != null) { |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 } | 704 } |
705 | 705 |
706 /// Called when `const Symbol(name)` is seen. | 706 /// Called when `const Symbol(name)` is seen. |
707 void registerConstSymbol(String name) { | 707 void registerConstSymbol(String name) { |
708 symbolsUsed.add(name); | 708 symbolsUsed.add(name); |
709 if (name.endsWith('=')) { | 709 if (name.endsWith('=')) { |
710 symbolsUsed.add(name.substring(0, name.length - 1)); | 710 symbolsUsed.add(name.substring(0, name.length - 1)); |
711 } | 711 } |
712 } | 712 } |
713 } | 713 } |
OLD | NEW |