| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library dart2js.selector; | 5 library dart2js.selector; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/names.dart' show | 8 import '../common/names.dart' show |
| 9 Names; | 9 Names; |
| 10 import '../elements/elements.dart' show | 10 import '../elements/elements.dart' show |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 final String name; | 27 final String name; |
| 28 final int hashCode; | 28 final int hashCode; |
| 29 const SelectorKind(this.name, this.hashCode); | 29 const SelectorKind(this.name, this.hashCode); |
| 30 | 30 |
| 31 static const SelectorKind GETTER = const SelectorKind('getter', 0); | 31 static const SelectorKind GETTER = const SelectorKind('getter', 0); |
| 32 static const SelectorKind SETTER = const SelectorKind('setter', 1); | 32 static const SelectorKind SETTER = const SelectorKind('setter', 1); |
| 33 static const SelectorKind CALL = const SelectorKind('call', 2); | 33 static const SelectorKind CALL = const SelectorKind('call', 2); |
| 34 static const SelectorKind OPERATOR = const SelectorKind('operator', 3); | 34 static const SelectorKind OPERATOR = const SelectorKind('operator', 3); |
| 35 static const SelectorKind INDEX = const SelectorKind('index', 4); | 35 static const SelectorKind INDEX = const SelectorKind('index', 4); |
| 36 | 36 |
| 37 int get index => hashCode; |
| 38 |
| 37 String toString() => name; | 39 String toString() => name; |
| 40 |
| 41 static List<SelectorKind> values = |
| 42 const <SelectorKind>[GETTER, SETTER, CALL, OPERATOR, INDEX]; |
| 38 } | 43 } |
| 39 | 44 |
| 40 class Selector { | 45 class Selector { |
| 41 final SelectorKind kind; | 46 final SelectorKind kind; |
| 42 final Name memberName; | 47 final Name memberName; |
| 43 final CallStructure callStructure; | 48 final CallStructure callStructure; |
| 44 | 49 |
| 45 final int hashCode; | 50 final int hashCode; |
| 46 | 51 |
| 47 int get argumentCount => callStructure.argumentCount; | 52 int get argumentCount => callStructure.argumentCount; |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 // Add bits from the call structure. | 278 // Add bits from the call structure. |
| 274 return Hashing.mixHashCodeBits(hash, callStructure.hashCode); | 279 return Hashing.mixHashCodeBits(hash, callStructure.hashCode); |
| 275 } | 280 } |
| 276 | 281 |
| 277 String toString() { | 282 String toString() { |
| 278 return 'Selector($kind, $name, ${callStructure.structureToString()})'; | 283 return 'Selector($kind, $name, ${callStructure.structureToString()})'; |
| 279 } | 284 } |
| 280 | 285 |
| 281 Selector toCallSelector() => new Selector.callClosureFrom(this); | 286 Selector toCallSelector() => new Selector.callClosureFrom(this); |
| 282 } | 287 } |
| OLD | NEW |