| 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 /// Called by [MirrorUsageAnalyzerTask] after it has merged all @MirrorsUsed | 215 /// Called by [MirrorUsageAnalyzerTask] after it has merged all @MirrorsUsed |
| 216 /// annotations. The arguments corresponds to the unions of the corresponding | 216 /// annotations. The arguments corresponds to the unions of the corresponding |
| 217 /// fields of the annotations. | 217 /// fields of the annotations. |
| 218 void registerMirrorUsage(Set<String> symbols, | 218 void registerMirrorUsage(Set<String> symbols, |
| 219 Set<Element> targets, | 219 Set<Element> targets, |
| 220 Set<Element> metaTargets) {} | 220 Set<Element> metaTargets) {} |
| 221 | 221 |
| 222 /// Returns true if this element should be retained for reflection even if it | 222 /// Returns true if this element should be retained for reflection even if it |
| 223 /// would normally be tree-shaken away. | 223 /// would normally be tree-shaken away. |
| 224 bool isNeededForReflection(Element element) => false; | 224 bool isNeededForReflection(Element element) => false; |
| 225 |
| 226 /// Returns true if global optimizations such as type inferencing |
| 227 /// can apply to this element. One category of elements that do not |
| 228 /// apply is runtime helpers that the backend calls, but the |
| 229 /// optimizations don't see those calls. |
| 230 bool canBeUsedForGlobalOptimizations(Element element); |
| 225 } | 231 } |
| 226 | 232 |
| 227 /** | 233 /** |
| 228 * Key class used in [TokenMap] in which the hash code for a token is based | 234 * Key class used in [TokenMap] in which the hash code for a token is based |
| 229 * on the [charOffset]. | 235 * on the [charOffset]. |
| 230 */ | 236 */ |
| 231 class TokenKey { | 237 class TokenKey { |
| 232 final Token token; | 238 final Token token; |
| 233 TokenKey(this.token); | 239 TokenKey(this.token); |
| 234 int get hashCode => token.charOffset; | 240 int get hashCode => token.charOffset; |
| (...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1480 | 1486 |
| 1481 void close() {} | 1487 void close() {} |
| 1482 | 1488 |
| 1483 toString() => name; | 1489 toString() => name; |
| 1484 | 1490 |
| 1485 /// Convenience method for getting an [api.CompilerOutputProvider]. | 1491 /// Convenience method for getting an [api.CompilerOutputProvider]. |
| 1486 static NullSink outputProvider(String name, String extension) { | 1492 static NullSink outputProvider(String name, String extension) { |
| 1487 return new NullSink('$name.$extension'); | 1493 return new NullSink('$name.$extension'); |
| 1488 } | 1494 } |
| 1489 } | 1495 } |
| OLD | NEW |