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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/program_builder/collector.dart

Issue 2314703002: Split World usage into open, inference, and closed world. (Closed)
Patch Set: Updated cf. comments Created 4 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 part of dart2js.js_emitter.program_builder; 5 part of dart2js.js_emitter.program_builder;
6 6
7 /** 7 /**
8 * Generates the code for all used classes in the program. Static fields (even 8 * Generates the code for all used classes in the program. Static fields (even
9 * in classes) are ignored, since they can be treated as non-class elements. 9 * in classes) are ignored, since they can be treated as non-class elements.
10 * 10 *
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 outputConstantLists 163 outputConstantLists
164 .putIfAbsent(constantUnit, () => new List<ConstantValue>()) 164 .putIfAbsent(constantUnit, () => new List<ConstantValue>())
165 .add(constant); 165 .add(constant);
166 } 166 }
167 } 167 }
168 168
169 /// Compute all the classes and typedefs that must be emitted. 169 /// Compute all the classes and typedefs that must be emitted.
170 void computeNeededDeclarations() { 170 void computeNeededDeclarations() {
171 // Compute needed typedefs. 171 // Compute needed typedefs.
172 typedefsNeededForReflection = Elements.sortedByPosition(compiler 172 typedefsNeededForReflection = Elements.sortedByPosition(compiler
173 .world.allTypedefs 173 .closedWorld.allTypedefs
174 .where(backend.isAccessibleByReflection) 174 .where(backend.isAccessibleByReflection)
175 .toList()); 175 .toList());
176 176
177 // Compute needed classes. 177 // Compute needed classes.
178 Set<ClassElement> instantiatedClasses = compiler 178 Set<ClassElement> instantiatedClasses = compiler
179 .codegenWorld.directlyInstantiatedClasses 179 .codegenWorld.directlyInstantiatedClasses
180 .where(computeClassFilter()) 180 .where(computeClassFilter())
181 .toSet(); 181 .toSet();
182 182
183 void addClassWithSuperclasses(ClassElement cls) { 183 void addClassWithSuperclasses(ClassElement cls) {
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 } 315 }
316 316
317 void collect() { 317 void collect() {
318 computeNeededDeclarations(); 318 computeNeededDeclarations();
319 computeNeededConstants(); 319 computeNeededConstants();
320 computeNeededStatics(); 320 computeNeededStatics();
321 computeNeededStaticNonFinalFields(); 321 computeNeededStaticNonFinalFields();
322 computeNeededLibraries(); 322 computeNeededLibraries();
323 } 323 }
324 } 324 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698