@@ -48,6 +48,7 @@ internal class OverriddenFunctionInfo(
48
48
&& function.bridgeDirectionsTo(overriddenFunction).allNotNeeded()
49
49
50
50
fun getImplementation (context : Context ): IrSimpleFunction ? {
51
+
51
52
val target = function.target
52
53
val implementation = if (! needBridge)
53
54
target
@@ -272,7 +273,7 @@ internal class ClassLayoutBuilder(val irClass: IrClass, val context: Context) {
272
273
273
274
DEBUG_OUTPUT (0 ) {
274
275
println ()
275
- println (" BUILDING vTable for ${irClass.descriptor } " )
276
+ println (" BUILDING vTable for ${irClass.render() } " )
276
277
}
277
278
278
279
val superVtableEntries = if (irClass.isSpecialClassWithNoSupertypes()) {
@@ -288,11 +289,11 @@ internal class ClassLayoutBuilder(val irClass: IrClass, val context: Context) {
288
289
DEBUG_OUTPUT (0 ) {
289
290
println ()
290
291
println (" SUPER vTable:" )
291
- superVtableEntries.forEach { println (" ${it.overriddenFunction.descriptor } -> ${it.function.descriptor } " ) }
292
+ superVtableEntries.forEach { println (" ${it.overriddenFunction.render() } -> ${it.function.render() } " ) }
292
293
293
294
println ()
294
295
println (" METHODS:" )
295
- methods.forEach { println (" ${it.descriptor } " ) }
296
+ methods.forEach { println (" ${it.render() } " ) }
296
297
297
298
println ()
298
299
println (" BUILDING INHERITED vTable" )
@@ -302,13 +303,13 @@ internal class ClassLayoutBuilder(val irClass: IrClass, val context: Context) {
302
303
val overridingMethod = methods.singleOrNull { it.overrides(superMethod.function) }
303
304
if (overridingMethod == null ) {
304
305
305
- DEBUG_OUTPUT (0 ) { println (" Taking super ${superMethod.overriddenFunction.descriptor } -> ${superMethod.function.descriptor } " ) }
306
+ DEBUG_OUTPUT (0 ) { println (" Taking super ${superMethod.overriddenFunction.render() } -> ${superMethod.function.render() } " ) }
306
307
307
308
superMethod
308
309
} else {
309
310
newVtableSlots.add(OverriddenFunctionInfo (overridingMethod, superMethod.function))
310
311
311
- DEBUG_OUTPUT (0 ) { println (" Taking overridden ${superMethod.overriddenFunction.descriptor } -> ${overridingMethod.descriptor } " ) }
312
+ DEBUG_OUTPUT (0 ) { println (" Taking overridden ${superMethod.overriddenFunction.render() } -> ${overridingMethod.render() } " ) }
312
313
313
314
OverriddenFunctionInfo (overridingMethod, superMethod.overriddenFunction)
314
315
}
@@ -320,18 +321,19 @@ internal class ClassLayoutBuilder(val irClass: IrClass, val context: Context) {
320
321
val inheritedVtableSlotsSet = inheritedVtableSlots.map { it.function to it.bridgeDirections }.toSet()
321
322
322
323
val filteredNewVtableSlots = newVtableSlots
323
- .filterNot { inheritedVtableSlotsSet.contains(it.function to it.bridgeDirections) }
324
- .distinctBy { it.function to it.bridgeDirections }
325
- .filter { it.function.isOverridable }
324
+ .filterNot { inheritedVtableSlotsSet.contains(it.function to it.bridgeDirections) }
325
+ .distinctBy { it.function to it.bridgeDirections }
326
+ .filter { it.function.isOverridable }
326
327
327
328
DEBUG_OUTPUT (0 ) {
328
329
println ()
329
330
println (" INHERITED vTable slots:" )
330
- inheritedVtableSlots.forEach { println (" ${it.overriddenFunction.descriptor } -> ${it.function.descriptor } " ) }
331
+ inheritedVtableSlots.forEach { println (" ${it.overriddenFunction.render() } -> ${it.function.render() } " ) }
331
332
332
333
println ()
333
334
println (" MY OWN vTable slots:" )
334
- filteredNewVtableSlots.forEach { println (" ${it.overriddenFunction.descriptor} -> ${it.function.descriptor} " ) }
335
+ filteredNewVtableSlots.forEach { println (" ${it.overriddenFunction.render()} -> ${it.function.render()} ${it.function} " ) }
336
+ println (" DONE vTable for ${irClass.render()} " )
335
337
}
336
338
337
339
inheritedVtableSlots + filteredNewVtableSlots.sortedBy { it.overriddenFunction.uniqueId }
@@ -340,7 +342,7 @@ internal class ClassLayoutBuilder(val irClass: IrClass, val context: Context) {
340
342
fun vtableIndex (function : IrSimpleFunction ): Int {
341
343
val bridgeDirections = function.target.bridgeDirectionsTo(function)
342
344
val index = vtableEntries.indexOfFirst { it.function == function && it.bridgeDirections == bridgeDirections }
343
- if (index < 0 ) throw Error (function.toString () + " not in vtable of " + irClass.toString ())
345
+ if (index < 0 ) throw Error (function.render () + " $function " + " ( ${function.symbol.descriptor} ) not in vtable of " + irClass.render ())
344
346
return index
345
347
}
346
348
0 commit comments