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" description = "Handle tailrec calls"
) )
@Suppress("Reformat") @Suppress("Reformat")
private val jvmFilePhases = private val jvmFilePhases =
renameAnonymousParametersLowering then renameAnonymousParametersLowering then
@@ -337,9 +338,9 @@ private val jvmFilePhases =
initializersCleanupPhase then initializersCleanupPhase then
collectionStubMethodLowering then collectionStubMethodLowering then
functionNVarargBridgePhase then functionNVarargBridgePhase then
bridgePhase then
jvmStaticAnnotationPhase then jvmStaticAnnotationPhase then
staticDefaultFunctionPhase then staticDefaultFunctionPhase then
bridgePhase then
syntheticAccessorPhase then syntheticAccessorPhase then
jvmArgumentNullabilityAssertions then jvmArgumentNullabilityAssertions then
@@ -355,7 +356,6 @@ private val jvmFilePhases =
fakeInliningLocalVariablesLowering then fakeInliningLocalVariablesLowering then
makePatchParentsPhase(3) makePatchParentsPhase(3)
val jvmPhases = namedIrModulePhase( val jvmPhases = namedIrModulePhase(
name = "IrLowering", name = "IrLowering",
description = "IR lowering", description = "IR lowering",
@@ -154,11 +154,8 @@ private class BridgeLowering(val context: JvmBackendContext) : FileLoweringPass,
if (Visibilities.isPrivate(irFunction.visibility) || irFunction.isStatic || irFunction.overriddenSymbols.isEmpty()) if (Visibilities.isPrivate(irFunction.visibility) || irFunction.isStatic || irFunction.overriddenSymbols.isEmpty())
return false return false
// We ignore (fake overrides of) default argument stubs and methods of Any. // None of the methods of Any have type parameters and so we will not need bridges for them.
// Default argument stubs only appear in the base class and are synthetic, so there is no reason to produce if (irFunction.isMethodOfAny())
// 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())
return false return false
// We don't produce bridges for abstract functions in interfaces. // We don't produce bridges for abstract functions in interfaces.