@@ -169,7 +169,6 @@ object WasmContext {
169
169
val kind : ClassKind ,
170
170
val jsClassCaptures : Option [List [ParamDef ]],
171
171
val allFieldDefs : List [FieldDef ],
172
- superClass : Option [ClassInfo ],
173
172
val classImplementsAnyInterface : Boolean ,
174
173
val hasInstances : Boolean ,
175
174
val isAbstract : Boolean ,
@@ -179,14 +178,12 @@ object WasmContext {
179
178
val staticFieldMirrors : Map [FieldName , List [String ]],
180
179
_specialInstanceTypes : Int , // should be `val` but there is a large Scaladoc for it below
181
180
val resolvedMethodInfos : Map [MethodName , ConcreteMethodInfo ],
181
+ val tableEntries : List [MethodName ],
182
182
_itableIdx : Int
183
183
) {
184
184
override def toString (): String =
185
185
s " ClassInfo( ${name.nameString}) "
186
186
187
- /** For a class or interface, its table entries in definition order. */
188
- private var _tableEntries : List [MethodName ] = null
189
-
190
187
/** Returns the index of this interface's itable in the classes' interface tables.
191
188
*
192
189
* Only interfaces that have instances get an itable index.
@@ -246,42 +243,6 @@ object WasmContext {
246
243
247
244
def isInterface : Boolean =
248
245
kind == ClassKind .Interface
249
-
250
- def buildMethodTable (methodsCalledDynamically0 : Set [MethodName ]): Unit = {
251
- if (_tableEntries != null )
252
- throw new IllegalStateException (s " Duplicate call to buildMethodTable() for $name" )
253
-
254
- val methodsCalledDynamically : List [MethodName ] =
255
- if (hasInstances) methodsCalledDynamically0.toList
256
- else Nil
257
-
258
- kind match {
259
- case ClassKind .Class | ClassKind .ModuleClass | ClassKind .HijackedClass =>
260
- val superTableEntries = superClass.fold[List [MethodName ]](Nil )(_.tableEntries)
261
- val superTableEntrySet = superTableEntries.toSet
262
-
263
- /* When computing the table entries to add for this class, exclude
264
- * methods that are already in the super class' table entries.
265
- */
266
- val newTableEntries = methodsCalledDynamically
267
- .filter(! superTableEntrySet.contains(_))
268
- .sorted // for stability
269
-
270
- _tableEntries = superTableEntries ::: newTableEntries
271
-
272
- case ClassKind .Interface =>
273
- _tableEntries = methodsCalledDynamically.sorted // for stability
274
-
275
- case _ =>
276
- _tableEntries = Nil
277
- }
278
- }
279
-
280
- def tableEntries : List [MethodName ] = {
281
- if (_tableEntries == null )
282
- throw new IllegalStateException (s " Table not yet built for $name" )
283
- _tableEntries
284
- }
285
246
}
286
247
287
248
final class ConcreteMethodInfo (val ownerClass : ClassName , val methodName : MethodName ) {
0 commit comments