| 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 dart2js.world; | 5 library dart2js.world; |
| 6 | 6 |
| 7 import 'closure.dart' show SynthesizedCallMethodElementX; | 7 import 'closure.dart' show SynthesizedCallMethodElementX; |
| 8 import 'common.dart'; | 8 import 'common.dart'; |
| 9 import 'common/backend_api.dart' show Backend; | 9 import 'common/backend_api.dart' show Backend; |
| 10 import 'compiler.dart' show Compiler; | 10 import 'compiler.dart' show Compiler; |
| (...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 getClassHierarchyNode(coreClasses.objectClass) | 689 getClassHierarchyNode(coreClasses.objectClass) |
| 690 .printOn(sb, ' ', instantiatedOnly: cls == null, withRespectTo: cls); | 690 .printOn(sb, ' ', instantiatedOnly: cls == null, withRespectTo: cls); |
| 691 return sb.toString(); | 691 return sb.toString(); |
| 692 } | 692 } |
| 693 | 693 |
| 694 void registerMixinUse( | 694 void registerMixinUse( |
| 695 MixinApplicationElement mixinApplication, ClassElement mixin) { | 695 MixinApplicationElement mixinApplication, ClassElement mixin) { |
| 696 // TODO(johnniwinther): Add map restricted to live classes. | 696 // TODO(johnniwinther): Add map restricted to live classes. |
| 697 // We don't support patch classes as mixin. | 697 // We don't support patch classes as mixin. |
| 698 assert(mixin.isDeclaration); | 698 assert(mixin.isDeclaration); |
| 699 Set<MixinApplicationElement> users = _mixinUses.putIfAbsent( | 699 Set<MixinApplicationElement> users = |
| 700 mixin, () => new Set<MixinApplicationElement>()); | 700 _mixinUses.putIfAbsent(mixin, () => new Set<MixinApplicationElement>()); |
| 701 users.add(mixinApplication); | 701 users.add(mixinApplication); |
| 702 } | 702 } |
| 703 | 703 |
| 704 bool hasAnyUserDefinedGetter(Selector selector, ti.TypeMask mask) { | 704 bool hasAnyUserDefinedGetter(Selector selector, ti.TypeMask mask) { |
| 705 return allFunctions.filter(selector, mask).any((each) => each.isGetter); | 705 return allFunctions.filter(selector, mask).any((each) => each.isGetter); |
| 706 } | 706 } |
| 707 | 707 |
| 708 void registerUsedElement(Element element) { | 708 void registerUsedElement(Element element) { |
| 709 if (element.isInstanceMember && !element.isAbstract) { | 709 if (element.isInstanceMember && !element.isAbstract) { |
| 710 allFunctions.add(element); | 710 allFunctions.add(element); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 // function expressions's element. | 826 // function expressions's element. |
| 827 // TODO(herhut): Generate classes for function expressions earlier. | 827 // TODO(herhut): Generate classes for function expressions earlier. |
| 828 if (element is SynthesizedCallMethodElementX) { | 828 if (element is SynthesizedCallMethodElementX) { |
| 829 return getMightBePassedToApply(element.expression); | 829 return getMightBePassedToApply(element.expression); |
| 830 } | 830 } |
| 831 return functionsThatMightBePassedToApply.contains(element); | 831 return functionsThatMightBePassedToApply.contains(element); |
| 832 } | 832 } |
| 833 | 833 |
| 834 bool get hasClosedWorldAssumption => !compiler.options.hasIncrementalSupport; | 834 bool get hasClosedWorldAssumption => !compiler.options.hasIncrementalSupport; |
| 835 } | 835 } |
| OLD | NEW |