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

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

Issue 10949003: Revert r12491 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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/ssa/ssa.dart ('k') | lib/core/object.dart » ('j') | 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 Compiler compiler; 6 final Compiler compiler;
7 final Map<ClassElement, Set<ClassElement>> subtypes; 7 final Map<ClassElement, Set<ClassElement>> subtypes;
8 final Set<ClassElement> classesNeedingRti; 8 final Set<ClassElement> classesNeedingRti;
9 final Map<ClassElement, Set<ClassElement>> rtiDependencies; 9 final Map<ClassElement, Set<ClassElement>> rtiDependencies;
10 final FunctionSet userDefinedGetters; 10 final FunctionSet userDefinedGetters;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 while (!worklist.isEmpty()) { 65 while (!worklist.isEmpty()) {
66 Element e = worklist.removeLast(); 66 Element e = worklist.removeLast();
67 Set<Element> dependencies = rtiDependencies[e]; 67 Set<Element> dependencies = rtiDependencies[e];
68 if (dependencies == null) continue; 68 if (dependencies == null) continue;
69 dependencies.forEach((Element other) { 69 dependencies.forEach((Element other) {
70 potentiallyAddForRti(other, () => worklist.add(other)); 70 potentiallyAddForRti(other, () => worklist.add(other));
71 }); 71 });
72 } 72 }
73 } 73 }
74 74
75 bool needsRti(ClassElement cls) { 75 bool needsRti(ClassElement cls) => classesNeedingRti.contains(cls);
76 return classesNeedingRti.contains(cls) || compiler.enabledRuntimeType;
77 }
78 76
79 void registerRtiDependency(Element element, Element dependency) { 77 void registerRtiDependency(Element element, Element dependency) {
80 // We're not dealing with typedef for now. 78 // We're not dealing with typedef for now.
81 if (!element.isClass() || !dependency.isClass()) return; 79 if (!element.isClass() || !dependency.isClass()) return;
82 Set<ClassElement> classes = 80 Set<ClassElement> classes =
83 rtiDependencies.putIfAbsent(element, () => new Set<ClassElement>()); 81 rtiDependencies.putIfAbsent(element, () => new Set<ClassElement>());
84 classes.add(dependency); 82 classes.add(dependency);
85 } 83 }
86 84
87 void recordUserDefinedGetter(Element element) { 85 void recordUserDefinedGetter(Element element) {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 final SourceString name; 167 final SourceString name;
170 168
171 MemberSet(SourceString this.name) : elements = new Set<Element>(); 169 MemberSet(SourceString this.name) : elements = new Set<Element>();
172 170
173 void add(Element element) { 171 void add(Element element) {
174 elements.add(element); 172 elements.add(element);
175 } 173 }
176 174
177 bool isEmpty() => elements.isEmpty(); 175 bool isEmpty() => elements.isEmpty();
178 } 176 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/ssa.dart ('k') | lib/core/object.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698