@@ -159,9 +159,6 @@ class ClassInfo {
159
159
160
160
ClassInfo ? _repr;
161
161
162
- /// All classes which implement this class. This is used to compute `repr` .
163
- final List <ClassInfo > implementedBy = [];
164
-
165
162
/// Nullabe Wasm ref type for this class.
166
163
final w.RefType nullableType;
167
164
@@ -175,9 +172,7 @@ class ClassInfo {
175
172
ClassInfo (this .cls, this .classId, this .depth, this .struct, this .superInfo,
176
173
{this .typeParameterMatch = const {}})
177
174
: nullableType = w.RefType .def (struct, nullable: true ),
178
- nonNullableType = w.RefType .def (struct, nullable: false ) {
179
- implementedBy.add (this );
180
- }
175
+ nonNullableType = w.RefType .def (struct, nullable: false );
181
176
182
177
void _addField (w.FieldType fieldType, [int ? expectedIndex]) {
183
178
assert (expectedIndex == null || expectedIndex == struct.fields.length);
@@ -294,7 +289,6 @@ class ClassInfoCollector {
294
289
info = ClassInfo (cls, classId, superInfo.depth + 1 , struct, superInfo);
295
290
// Mark Top type as implementing Object to force the representation
296
291
// type of Object to be Top.
297
- info.implementedBy.add (topInfo);
298
292
} else {
299
293
// Recursively initialize all supertypes before initializing this class.
300
294
_createStructForClass (classIds, superclass);
@@ -339,16 +333,6 @@ class ClassInfoCollector {
339
333
m.types.defineStruct (cls.name, superType: superInfo.struct);
340
334
info = ClassInfo (cls, classId, superInfo.depth + 1 , struct, superInfo,
341
335
typeParameterMatch: typeParameterMatch);
342
-
343
- // Mark all interfaces as being implemented by this class. This is
344
- // needed to calculate representation types.
345
- for (Supertype interface in cls.implementedTypes) {
346
- ClassInfo ? interfaceInfo = translator.classInfo[interface .classNode];
347
- while (interfaceInfo != null ) {
348
- interfaceInfo.implementedBy.add (info);
349
- interfaceInfo = interfaceInfo.superInfo;
350
- }
351
- }
352
336
}
353
337
translator.classesSupersFirst.add (info);
354
338
translator.classes[classId] = info;
@@ -498,7 +482,7 @@ class ClassInfoCollector {
498
482
}
499
483
final classId = classIdNumbering.classIds[cls]! ;
500
484
final info = translator.classes[classId];
501
- info._repr = representation ?? translator.classes[classId] ;
485
+ info._repr = representation ?? info ;
502
486
}
503
487
504
488
// Now that the representation types for all classes have been computed,
0 commit comments