| 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 library universe; | 5 library universe; |
| 6 | 6 |
| 7 import '../elements/elements.dart'; | 7 import '../elements/elements.dart'; |
| 8 import '../dart2jslib.dart'; | 8 import '../dart2jslib.dart'; |
| 9 import '../dart_types.dart'; | 9 import '../dart_types.dart'; |
| 10 import '../types/types.dart'; | 10 import '../types/types.dart'; |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 static const Name CALL_NAME = const PublicName(Compiler.CALL_OPERATOR_NAME); | 537 static const Name CALL_NAME = const PublicName(Compiler.CALL_OPERATOR_NAME); |
| 538 | 538 |
| 539 Selector.internal(this.kind, | 539 Selector.internal(this.kind, |
| 540 this.memberName, | 540 this.memberName, |
| 541 this.callStructure, | 541 this.callStructure, |
| 542 this.hashCode) { | 542 this.hashCode) { |
| 543 assert(kind == SelectorKind.INDEX || | 543 assert(kind == SelectorKind.INDEX || |
| 544 (memberName != INDEX_NAME && memberName != INDEX_SET_NAME)); | 544 (memberName != INDEX_NAME && memberName != INDEX_SET_NAME)); |
| 545 assert(kind == SelectorKind.OPERATOR || | 545 assert(kind == SelectorKind.OPERATOR || |
| 546 kind == SelectorKind.INDEX || | 546 kind == SelectorKind.INDEX || |
| 547 !Elements.isOperatorName(memberName.text)); | 547 !Elements.isOperatorName(memberName.text) || |
| 548 identical(memberName.text, '??')); |
| 548 assert(kind == SelectorKind.CALL || | 549 assert(kind == SelectorKind.CALL || |
| 549 kind == SelectorKind.GETTER || | 550 kind == SelectorKind.GETTER || |
| 550 kind == SelectorKind.SETTER || | 551 kind == SelectorKind.SETTER || |
| 551 Elements.isOperatorName(memberName.text)); | 552 Elements.isOperatorName(memberName.text) || |
| 553 identical(memberName.text, '??')); |
| 552 } | 554 } |
| 553 | 555 |
| 554 // TODO(johnniwinther): Extract caching. | 556 // TODO(johnniwinther): Extract caching. |
| 555 static Map<int, List<Selector>> canonicalizedValues = | 557 static Map<int, List<Selector>> canonicalizedValues = |
| 556 new Map<int, List<Selector>>(); | 558 new Map<int, List<Selector>>(); |
| 557 | 559 |
| 558 factory Selector(SelectorKind kind, | 560 factory Selector(SelectorKind kind, |
| 559 Name name, | 561 Name name, |
| 560 CallStructure callStructure) { | 562 CallStructure callStructure) { |
| 561 // TODO(johnniwinther): Maybe use equality instead of implicit hashing. | 563 // TODO(johnniwinther): Maybe use equality instead of implicit hashing. |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 | 862 |
| 861 Selector extendIfReachesAll(Compiler compiler) { | 863 Selector extendIfReachesAll(Compiler compiler) { |
| 862 bool canReachAll = compiler.enabledInvokeOn | 864 bool canReachAll = compiler.enabledInvokeOn |
| 863 && mask.needsNoSuchMethodHandling(this, compiler.world); | 865 && mask.needsNoSuchMethodHandling(this, compiler.world); |
| 864 return canReachAll | 866 return canReachAll |
| 865 ? new TypedSelector( | 867 ? new TypedSelector( |
| 866 compiler.typesTask.dynamicType, this, compiler.world) | 868 compiler.typesTask.dynamicType, this, compiler.world) |
| 867 : this; | 869 : this; |
| 868 } | 870 } |
| 869 } | 871 } |
| OLD | NEW |