| 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 /// This library defines individual world impacts. | 5 /// This library defines individual world impacts. |
| 6 /// | 6 /// |
| 7 /// We call these building blocks `uses`. Each `use` is a single impact of the | 7 /// We call these building blocks `uses`. Each `use` is a single impact of the |
| 8 /// world. Some example uses are: | 8 /// world. Some example uses are: |
| 9 /// | 9 /// |
| 10 /// * an invocation of a top level function | 10 /// * an invocation of a top level function |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 CLOSURE, | 80 CLOSURE, |
| 81 CALL_METHOD, | 81 CALL_METHOD, |
| 82 CONSTRUCTOR_INVOKE, | 82 CONSTRUCTOR_INVOKE, |
| 83 CONST_CONSTRUCTOR_INVOKE, | 83 CONST_CONSTRUCTOR_INVOKE, |
| 84 REDIRECTION, | 84 REDIRECTION, |
| 85 DIRECT_INVOKE, | 85 DIRECT_INVOKE, |
| 86 DIRECT_USE, | 86 DIRECT_USE, |
| 87 INLINING, | 87 INLINING, |
| 88 } | 88 } |
| 89 | 89 |
| 90 /// Statically known use of an [Element]. | 90 /// Statically known use of an [Entity]. |
| 91 // TODO(johnniwinther): Create backend-specific implementations with better | 91 // TODO(johnniwinther): Create backend-specific implementations with better |
| 92 // invariants. | 92 // invariants. |
| 93 class StaticUse { | 93 class StaticUse { |
| 94 final Entity element; | 94 final Entity element; |
| 95 final StaticUseKind kind; | 95 final StaticUseKind kind; |
| 96 final int hashCode; | 96 final int hashCode; |
| 97 final DartType type; | 97 final DartType type; |
| 98 | 98 |
| 99 StaticUse.internal(Entity element, StaticUseKind kind, [DartType type = null]) | 99 StaticUse.internal(Entity element, StaticUseKind kind, [DartType type = null]) |
| 100 : this.element = element, | 100 : this.element = element, |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 : this._(value, ConstantUseKind.DIRECT); | 531 : this._(value, ConstantUseKind.DIRECT); |
| 532 | 532 |
| 533 bool operator ==(other) { | 533 bool operator ==(other) { |
| 534 if (identical(this, other)) return true; | 534 if (identical(this, other)) return true; |
| 535 if (other is! ConstantUse) return false; | 535 if (other is! ConstantUse) return false; |
| 536 return value == other.value; | 536 return value == other.value; |
| 537 } | 537 } |
| 538 | 538 |
| 539 String toString() => 'ConstantUse(${value.toStructuredText()},$kind)'; | 539 String toString() => 'ConstantUse(${value.toStructuredText()},$kind)'; |
| 540 } | 540 } |
| OLD | NEW |