| 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 class World { | 5 class World { |
| 6 Compiler compiler; // Set in populate(). | 6 Compiler compiler; // Set in populate(). |
| 7 final Map<ClassElement, Set<ClassElement>> subtypes; | 7 final Map<ClassElement, Set<ClassElement>> subtypes; |
| 8 | 8 |
| 9 World() : subtypes = new Map<ClassElement, Set<ClassElement>>(); | 9 World() : subtypes = new Map<ClassElement, Set<ClassElement>>(); |
| 10 | 10 |
| 11 void populate(Compiler compiler) { | 11 void populate(Compiler compiler) { |
| 12 void addSubtypes(ClassElement cls) { | 12 void addSubtypes(ClassElement cls) { |
| 13 if (cls.resolutionState != ClassElement.STATE_DONE) { | 13 if (cls.resolutionState != STATE_DONE) { |
| 14 compiler.internalErrorOnElement( | 14 compiler.internalErrorOnElement( |
| 15 cls, 'Class "${cls.name.slowToString()}" is not resolved.'); | 15 cls, 'Class "${cls.name.slowToString()}" is not resolved.'); |
| 16 } | 16 } |
| 17 for (Type type in cls.allSupertypes) { | 17 for (Type type in cls.allSupertypes) { |
| 18 Set<Element> subtypesOfCls = | 18 Set<Element> subtypesOfCls = |
| 19 subtypes.putIfAbsent(type.element, () => new Set<ClassElement>()); | 19 subtypes.putIfAbsent(type.element, () => new Set<ClassElement>()); |
| 20 subtypesOfCls.add(cls); | 20 subtypesOfCls.add(cls); |
| 21 } | 21 } |
| 22 } | 22 } |
| 23 | 23 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 final SourceString name; | 96 final SourceString name; |
| 97 | 97 |
| 98 MemberSet(SourceString this.name) : elements = new Set<Element>(); | 98 MemberSet(SourceString this.name) : elements = new Set<Element>(); |
| 99 | 99 |
| 100 void add(Element element) { | 100 void add(Element element) { |
| 101 elements.add(element); | 101 elements.add(element); |
| 102 } | 102 } |
| 103 | 103 |
| 104 bool isEmpty() => elements.isEmpty(); | 104 bool isEmpty() => elements.isEmpty(); |
| 105 } | 105 } |
| OLD | NEW |