JVM_IR: move BridgeLowering lower, remove special case for default arg stubs

This commit is contained in:
Georgy Bronnikov
2020-03-04 17:13:29 +03:00
parent af67aff303
commit 18d95bb670
2 changed files with 4 additions and 7 deletions
@@ -254,6 +254,7 @@ private val tailrecPhase = makeIrFilePhase<JvmBackendContext>(
description = "Handle tailrec calls"
)
@Suppress("Reformat")
private val jvmFilePhases =
renameAnonymousParametersLowering then
@@ -337,9 +338,9 @@ private val jvmFilePhases =
initializersCleanupPhase then
collectionStubMethodLowering then
functionNVarargBridgePhase then
bridgePhase then
jvmStaticAnnotationPhase then
staticDefaultFunctionPhase then
bridgePhase then
syntheticAccessorPhase then
jvmArgumentNullabilityAssertions then
@@ -355,7 +356,6 @@ private val jvmFilePhases =
fakeInliningLocalVariablesLowering then
makePatchParentsPhase(3)
val jvmPhases = namedIrModulePhase(
name = "IrLowering",
description = "IR lowering",
@@ -154,11 +154,8 @@ private class BridgeLowering(val context: JvmBackendContext) : FileLoweringPass,
if (Visibilities.isPrivate(irFunction.visibility) || irFunction.isStatic || irFunction.overriddenSymbols.isEmpty())
return false
// We ignore (fake overrides of) default argument stubs and methods of Any.
// Default argument stubs only appear in the base class and are synthetic, so there is no reason to produce
// bridges for them. Similarly, none of the methods of Any have type parameters and so we will not need bridges
// for them.
if (irFunction.origin == IrDeclarationOrigin.FUNCTION_FOR_DEFAULT_PARAMETER || irFunction.isMethodOfAny())
// None of the methods of Any have type parameters and so we will not need bridges for them.
if (irFunction.isMethodOfAny())
return false
// We don't produce bridges for abstract functions in interfaces.