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 dart2js; | 5 part of dart2js; |
6 | 6 |
7 /** | 7 /** |
8 * If true, print a warning for each method that was resolved, but not | 8 * If true, print a warning for each method that was resolved, but not |
9 * compiled. | 9 * compiled. |
10 */ | 10 */ |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
423 return new Future.value(); | 423 return new Future.value(); |
424 } | 424 } |
425 | 425 |
426 /// Called by [MirrorUsageAnalyzerTask] after it has merged all @MirrorsUsed | 426 /// Called by [MirrorUsageAnalyzerTask] after it has merged all @MirrorsUsed |
427 /// annotations. The arguments corresponds to the unions of the corresponding | 427 /// annotations. The arguments corresponds to the unions of the corresponding |
428 /// fields of the annotations. | 428 /// fields of the annotations. |
429 void registerMirrorUsage(Set<String> symbols, | 429 void registerMirrorUsage(Set<String> symbols, |
430 Set<Element> targets, | 430 Set<Element> targets, |
431 Set<Element> metaTargets) {} | 431 Set<Element> metaTargets) {} |
432 | 432 |
433 /// Returns true if this element should be retained for reflection even if it | 433 /// Returns true if this element needs reflection information at runtime. |
434 /// would normally be tree-shaken away. | 434 bool isAccessibleByReflection(Element element) => true; |
435 bool isNeededForReflection(Element element) => false; | 435 /// Returns true if this element is covered by a mirrorsUsed annotation but |
Johnni Winther
2014/06/27 07:43:00
Add an empty line before doc comments.
herhut
2014/06/27 12:34:35
Done.
| |
436 /// is ok to be treeshaken away. | |
Johnni Winther
2014/06/27 07:43:00
Add an example of how this is sound.
floitsch
2014/06/27 08:59:15
but might be ok to be treeshaken away.
herhut
2014/06/27 12:34:35
Done.
herhut
2014/06/27 12:34:35
Done.
| |
437 bool referencedFromMirrorSystem(Element element, [recursive]) => false; | |
438 /// Returns true if this element has to be enqueued due to | |
439 /// mirror usage. Might be a subset of the above. | |
440 bool requiredByMirrorSystem(Element element) => false; | |
Johnni Winther
2014/06/27 07:43:00
Give an example.
herhut
2014/06/27 12:34:35
Done.
| |
436 | 441 |
437 /// Returns true if global optimizations such as type inferencing | 442 /// Returns true if global optimizations such as type inferencing |
438 /// can apply to this element. One category of elements that do not | 443 /// can apply to this element. One category of elements that do not |
439 /// apply is runtime helpers that the backend calls, but the | 444 /// apply is runtime helpers that the backend calls, but the |
440 /// optimizations don't see those calls. | 445 /// optimizations don't see those calls. |
441 bool canBeUsedForGlobalOptimizations(Element element) => true; | 446 bool canBeUsedForGlobalOptimizations(Element element) => true; |
442 | 447 |
443 /// Called when [enqueuer]'s queue is empty, but before it is closed. | 448 /// Called when [enqueuer]'s queue is empty, but before it is closed. |
444 /// This is used, for example, by the JS backend to enqueue additional | 449 /// This is used, for example, by the JS backend to enqueue additional |
445 /// elements needed for reflection. | 450 /// elements needed for reflection. [recentClasses] is a collection of |
446 void onQueueEmpty(Enqueuer enqueuer) {} | 451 /// all classes added since the last call to onQueueEmpty. A return value |
Johnni Winther
2014/06/27 07:43:00
'added' -> 'added to the set of instantiation clas
herhut
2014/06/27 12:34:35
seen for the first time by the enqueuer....
| |
452 /// of [true] indicates that recentClasses has been processed and its | |
453 /// elements do not need to be seen in the next round. When [false] is | |
454 /// returned, [onQueueEmpty] will be called again and [recentClasses] | |
455 /// will be a superset of the current value. | |
Johnni Winther
2014/06/27 07:43:00
When is this needed?
herhut
2014/06/27 12:34:35
This allows each step in onQueueEmpty to abort pro
| |
456 bool onQueueEmpty(Enqueuer enqueuer, Iterable<ClassElement> recentClasses) {} | |
floitsch
2014/06/27 08:59:15
I don't like the name "onX" is something that allo
karlklose
2014/06/27 09:35:28
For me onX is something that allows me to do somet
floitsch
2014/06/27 12:05:38
That's not how it is used in most libraries. For e
herhut
2014/06/27 12:34:35
This needs a more global fix, so not in this CL...
Johnni Winther
2014/06/27 14:22:30
The `domElement.onClick` is a short-hand for getti
| |
447 | 457 |
448 /// Called after [element] has been resolved. | 458 /// Called after [element] has been resolved. |
449 // TODO(johnniwinther): Change [TreeElements] to [Registry] or a dependency | 459 // TODO(johnniwinther): Change [TreeElements] to [Registry] or a dependency |
450 // node. [elements] is currently unused by the implementation. | 460 // node. [elements] is currently unused by the implementation. |
451 void onElementResolved(Element element, TreeElements elements) {} | 461 void onElementResolved(Element element, TreeElements elements) {} |
452 | 462 |
453 // Does this element belong in the output | 463 // Does this element belong in the output |
454 bool shouldOutput(Element element) => true; | 464 bool shouldOutput(Element element) => true; |
455 } | 465 } |
456 | 466 |
(...skipping 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2017 static NullSink outputProvider(String name, String extension) { | 2027 static NullSink outputProvider(String name, String extension) { |
2018 return new NullSink('$name.$extension'); | 2028 return new NullSink('$name.$extension'); |
2019 } | 2029 } |
2020 } | 2030 } |
2021 | 2031 |
2022 /// Information about suppressed warnings and hints for a given library. | 2032 /// Information about suppressed warnings and hints for a given library. |
2023 class SuppressionInfo { | 2033 class SuppressionInfo { |
2024 int warnings = 0; | 2034 int warnings = 0; |
2025 int hints = 0; | 2035 int hints = 0; |
2026 } | 2036 } |
OLD | NEW |