Make reflective access to local delegated properties more robust
diff --git a/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/ReflectiveAccess.kt b/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/ReflectiveAccess.kt
index 34d88af..1c7c613 100644
--- a/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/ReflectiveAccess.kt
+++ b/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/ReflectiveAccess.kt
@@ -430,7 +430,7 @@
 
     private fun shouldUseAccessor(accessor: IrSimpleFunction): Boolean {
         return (context.generatorExtensions as StubGeneratorExtensions).isAccessorWithExplicitImplementation(accessor)
-                || accessor.origin == IrDeclarationOrigin.DELEGATED_PROPERTY_ACCESSOR
+                || accessor.correspondingPropertySymbol?.owner?.isDelegated == true
     }
 
     // Returns a pair of the _type_ containing the field and the _instance_ on
@@ -460,7 +460,7 @@
         if (shouldUseAccessor(getter)) {
             return generateReflectiveMethodInvocation(
                 getter.parentAsClass.defaultType,
-                JvmAbi.getterName(propertyName = property.name.asString()),
+                context.defaultMethodSignatureMapper.mapFunctionName(getter),
                 getter.extensionReceiverParameter?.let { listOf(it.type) } ?: listOf(),
                 call.dispatchReceiver,
                 listOfNotNull(call.extensionReceiver),