From 18d95bb670bf18919d11e1d9fc5a3a2680dfa87c Mon Sep 17 00:00:00 2001 From: Georgy Bronnikov Date: Wed, 4 Mar 2020 17:13:29 +0300 Subject: [PATCH] JVM_IR: move BridgeLowering lower, remove special case for default arg stubs --- .../src/org/jetbrains/kotlin/backend/jvm/JvmLower.kt | 4 ++-- .../jetbrains/kotlin/backend/jvm/lower/BridgeLowering.kt | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmLower.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmLower.kt index 963e9d7303a..50614e9edd8 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmLower.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmLower.kt @@ -254,6 +254,7 @@ private val tailrecPhase = makeIrFilePhase( 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", diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/BridgeLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/BridgeLowering.kt index 7b1f7429b3a..7de6be860e6 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/BridgeLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/BridgeLowering.kt @@ -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.