| 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 defined `uses`. A `use` is a single impact of the world, for | 5 /// This library defines individual world impacts. |
| 6 /// instance an invocation of a top level function or a call to the `foo()` | 6 /// |
| 7 /// method on an unknown class. | 7 /// We call these building blocks `uses`. Each `use` is a single impact of the |
| 8 /// world. Some example uses are: |
| 9 /// |
| 10 /// * an invocation of a top level function |
| 11 /// * a call to the `foo()` method on an unknown class. |
| 12 /// * an instantiation of class T |
| 13 /// |
| 14 /// The different compiler stages combine these uses into `WorldImpact` objects, |
| 15 /// which are later used to construct a closed-world understanding of the |
| 16 /// program. |
| 8 library dart2js.universe.use; | 17 library dart2js.universe.use; |
| 9 | 18 |
| 10 import '../closure.dart' show BoxFieldElement; | 19 import '../closure.dart' show BoxFieldElement; |
| 11 import '../common.dart'; | 20 import '../common.dart'; |
| 12 import '../dart_types.dart'; | 21 import '../dart_types.dart'; |
| 13 import '../elements/elements.dart'; | 22 import '../elements/elements.dart'; |
| 14 import '../util/util.dart' show Hashing; | 23 import '../util/util.dart' show Hashing; |
| 15 import '../world.dart' show ClassWorld; | 24 import '../world.dart' show ClassWorld; |
| 16 import 'call_structure.dart' show CallStructure; | 25 import 'call_structure.dart' show CallStructure; |
| 17 import 'selector.dart' show Selector; | 26 import 'selector.dart' show Selector; |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 } | 310 } |
| 302 | 311 |
| 303 bool operator ==(other) { | 312 bool operator ==(other) { |
| 304 if (identical(this, other)) return true; | 313 if (identical(this, other)) return true; |
| 305 if (other is! TypeUse) return false; | 314 if (other is! TypeUse) return false; |
| 306 return type == other.type && kind == other.kind; | 315 return type == other.type && kind == other.kind; |
| 307 } | 316 } |
| 308 | 317 |
| 309 String toString() => 'TypeUse($type,$kind)'; | 318 String toString() => 'TypeUse($type,$kind)'; |
| 310 } | 319 } |
| OLD | NEW |