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

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

Issue 2925263002: A step towards handling `new Object()` in compile_from_dill_test (Closed)
Patch Set: Updated cf. comments Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/js_emitter/program_builder/collector.dart
diff --git a/pkg/compiler/lib/src/js_emitter/program_builder/collector.dart b/pkg/compiler/lib/src/js_emitter/program_builder/collector.dart
index 3ed4bd44a64aa0b3e4a0d937e564c37e5d18080c..e69fb2746af4c897a962cbc5ef9afc5e04af1598 100644
--- a/pkg/compiler/lib/src/js_emitter/program_builder/collector.dart
+++ b/pkg/compiler/lib/src/js_emitter/program_builder/collector.dart
@@ -210,17 +210,17 @@ class Collector {
.where(computeClassFilter())
.toSet();
- void addClassWithSuperclasses(ClassElement cls) {
+ void addClassWithSuperclasses(ClassEntity cls) {
neededClasses.add(cls);
- for (ClassElement superclass = cls.superclass;
+ for (ClassEntity superclass = _elementEnvironment.getSuperClass(cls);
superclass != null;
- superclass = superclass.superclass) {
+ superclass = _elementEnvironment.getSuperClass(superclass)) {
neededClasses.add(superclass);
}
}
void addClassesWithSuperclasses(Iterable<ClassEntity> classes) {
- for (ClassElement cls in classes) {
+ for (ClassEntity cls in classes) {
addClassWithSuperclasses(cls);
}
}
@@ -229,10 +229,12 @@ class Collector {
addClassesWithSuperclasses(instantiatedClasses);
// 2. Add all classes used as mixins.
- Set<ClassElement> mixinClasses = neededClasses
- .where((ClassElement element) => element.isMixinApplication)
- .map(computeMixinClass)
- .toSet();
+ Set<ClassEntity> mixinClasses = new Set<ClassEntity>();
+ for (ClassEntity cls in neededClasses) {
+ _elementEnvironment.forEachMixin(cls, (ClassEntity mixinClass) {
+ mixinClasses.add(mixinClass);
+ });
+ }
neededClasses.addAll(mixinClasses);
// 3. Find all classes needed for rti.
@@ -282,13 +284,13 @@ class Collector {
nativeClassesAndSubclasses.add(cls);
assert(!_deferredLoadTask.isDeferredClass(cls), failedAt(cls));
outputClassLists
- .putIfAbsent(_deferredLoadTask.mainOutputUnit,
- () => new List<ClassElement>())
+ .putIfAbsent(
+ _deferredLoadTask.mainOutputUnit, () => new List<ClassEntity>())
.add(cls);
} else {
outputClassLists
.putIfAbsent(_deferredLoadTask.outputUnitForClass(cls),
- () => new List<ClassElement>())
+ () => new List<ClassEntity>())
.add(cls);
}
}
« no previous file with comments | « pkg/compiler/lib/src/js_backend/namer.dart ('k') | pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698