Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Side by Side Diff: lib/compiler/implementation/world.dart

Issue 10831125: Revert 'Port the remaining of dart:core to the unified corelib.' (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/compiler/implementation/lib/mock.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 final Map<ClassElement, Set<ClassElement>> subtypes; 6 final Map<ClassElement, Set<ClassElement>> subtypes;
7 7
8 World() : subtypes = new Map<ClassElement, Set<ClassElement>>(); 8 World() : subtypes = new Map<ClassElement, Set<ClassElement>>();
9 9
10 void populate(Compiler compiler, Collection<LibraryElement> libraries) { 10 void populate(Compiler compiler, Collection<LibraryElement> libraries) {
11 void addSubtypes(ClassElement cls) { 11 void addSubtypes(ClassElement cls) {
12 for (Type type in cls.allSupertypes) { 12 for (Type type in cls.allSupertypes) {
13 Set<Element> subtypesOfCls = subtypes.putIfAbsent( 13 Set<Element> subtypesOfCls = subtypes.putIfAbsent(
14 type.element, 14 type.element,
15 () => new Set<ClassElement>()); 15 () => new Set<ClassElement>());
16 subtypesOfCls.add(cls); 16 subtypesOfCls.add(cls);
17 } 17 }
18 } 18 }
19 19
20 libraries.forEach((LibraryElement library) { 20 libraries.forEach((LibraryElement library) {
21 for (Link<Element> link = library.topLevelElements; 21 for (Link<Element> link = library.topLevelElements;
22 !link.isEmpty(); 22 !link.isEmpty();
23 link = link.tail) { 23 link = link.tail) {
24 Element element = link.head; 24 Element element = link.head;
25 if (!element.isClass() || compiler.isPatchElement(element)) continue; 25 if (!element.isClass()) continue;
26 ClassElement cls = element; 26 ClassElement cls = element;
27 compiler.resolveClass(cls); 27 compiler.resolveClass(cls);
28 addSubtypes(cls); 28 addSubtypes(cls);
29 } 29 }
30 }); 30 });
31 } 31 }
32 32
33 /** 33 /**
34 * Returns a [MemberSet] that contains the possible targets of a 34 * Returns a [MemberSet] that contains the possible targets of a
35 * selector named [member] on a receiver whose type is [type]. 35 * selector named [member] on a receiver whose type is [type].
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 final SourceString name; 79 final SourceString name;
80 80
81 MemberSet(SourceString this.name) : elements = new Set<Element>(); 81 MemberSet(SourceString this.name) : elements = new Set<Element>();
82 82
83 void add(Element element) { 83 void add(Element element) {
84 elements.add(element); 84 elements.add(element);
85 } 85 }
86 86
87 bool isEmpty() => elements.isEmpty(); 87 bool isEmpty() => elements.isEmpty();
88 } 88 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/lib/mock.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698