JVM_IR. Align synthetic parameter name generation across backends
This commit is contained in:
+2
-3
@@ -278,6 +278,7 @@ class ExpressionCodegen(
|
||||
}
|
||||
|
||||
private fun writeParameterInLocalVariableTable(startLabel: Label, endLabel: Label) {
|
||||
if (irFunction.origin == IrDeclarationOrigin.FUNCTION_FOR_DEFAULT_PARAMETER) return
|
||||
if (!irFunction.isStatic) {
|
||||
mv.visitLocalVariable("this", classCodegen.type.descriptor, null, startLabel, endLabel, 0)
|
||||
}
|
||||
@@ -286,9 +287,7 @@ class ExpressionCodegen(
|
||||
writeValueParameterInLocalVariableTable(extensionReceiverParameter, startLabel, endLabel, true)
|
||||
}
|
||||
for (param in irFunction.valueParameters) {
|
||||
if (!param.origin.isSynthetic) {
|
||||
writeValueParameterInLocalVariableTable(param, startLabel, endLabel, false)
|
||||
}
|
||||
writeValueParameterInLocalVariableTable(param, startLabel, endLabel, false)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -7,6 +7,8 @@ package org.jetbrains.kotlin.backend.jvm.lower
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.FileLoweringPass
|
||||
import org.jetbrains.kotlin.backend.common.IrElementTransformerVoidWithContext
|
||||
import org.jetbrains.kotlin.backend.common.descriptors.synthesizedName
|
||||
import org.jetbrains.kotlin.backend.common.descriptors.synthesizedString
|
||||
import org.jetbrains.kotlin.backend.common.ir.*
|
||||
import org.jetbrains.kotlin.backend.jvm.JvmBackendContext
|
||||
import org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin
|
||||
@@ -177,7 +179,7 @@ internal class SyntheticAccessorLowering(val context: JvmBackendContext) : IrEle
|
||||
accessor.returnType = source.returnType.remapTypeParameters(source, accessor)
|
||||
|
||||
accessor.addValueParameter(
|
||||
"marker", context.ir.symbols.defaultConstructorMarker.defaultType, JvmLoweredDeclarationOrigin.SYNTHETIC_ACCESSOR
|
||||
"constructor_marker".synthesizedString, context.ir.symbols.defaultConstructorMarker.defaultType, JvmLoweredDeclarationOrigin.SYNTHETIC_ACCESSOR
|
||||
)
|
||||
|
||||
accessor.body = IrExpressionBodyImpl(
|
||||
|
||||
-7
@@ -3,13 +3,6 @@
|
||||
fun foo(param: String = "123") {}
|
||||
|
||||
|
||||
//TODO: align backends
|
||||
|
||||
// JVM_TEMPLATES
|
||||
// 1 LOCALVARIABLE param
|
||||
// 1 LOCALVARIABLE
|
||||
|
||||
// JVM_IR_TEMPLATES
|
||||
// 2 LOCALVARIABLE param
|
||||
// 2 LOCALVARIABLE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user