JVM: remove unused DefaultLambda.parameterOffsetsInDefault
This commit is contained in:
@@ -440,8 +440,6 @@ abstract class InlineCodegen<out T : BaseExpressionCodegen>(
|
||||
paramIndex,
|
||||
ValueKind.DEFAULT_LAMBDA_CAPTURED_PARAMETER
|
||||
)
|
||||
|
||||
defaultLambda.parameterOffsetsInDefault.add(invocationParamBuilder.nextParameterOffset)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,12 +83,9 @@ abstract class DefaultLambda(
|
||||
val offset: Int,
|
||||
val needReification: Boolean
|
||||
) : LambdaInfo(isCrossinline) {
|
||||
|
||||
final override var isBoundCallableReference by Delegates.notNull<Boolean>()
|
||||
private set
|
||||
|
||||
val parameterOffsetsInDefault: MutableList<Int> = arrayListOf()
|
||||
|
||||
final override lateinit var invokeMethod: Method
|
||||
private set
|
||||
|
||||
@@ -113,8 +110,10 @@ abstract class DefaultLambda(
|
||||
}
|
||||
capturedVars =
|
||||
if (isFunctionReference || isPropertyReference)
|
||||
constructor?.desc?.let { Type.getArgumentTypes(it) }?.singleOrNull()?.let {
|
||||
originalBoundReceiverType = it
|
||||
capturedArgs.singleOrNull()?.let {
|
||||
if (AsmUtil.isPrimitive(it)) {
|
||||
originalBoundReceiverType = it
|
||||
}
|
||||
listOf(capturedParamDesc(AsmUtil.RECEIVER_PARAMETER_NAME, AsmUtil.boxType(it), isSuspend = false))
|
||||
} ?: emptyList()
|
||||
else
|
||||
|
||||
@@ -425,10 +425,10 @@ class MethodInliner(
|
||||
if (DEFAULT_LAMBDA_FAKE_CALL == owner) {
|
||||
val index = name.substringAfter(DEFAULT_LAMBDA_FAKE_CALL).toInt()
|
||||
val lambda = getFunctionalArgumentIfExists(index) as DefaultLambda
|
||||
lambda.parameterOffsetsInDefault.zip(lambda.capturedVars).asReversed().forEach { (_, captured) ->
|
||||
val originalBoundReceiverType = lambda.originalBoundReceiverType
|
||||
if (lambda.isBoundCallableReference && AsmUtil.isPrimitive(originalBoundReceiverType)) {
|
||||
StackValue.onStack(originalBoundReceiverType!!).put(captured.type, InstructionAdapter(this))
|
||||
for (captured in lambda.capturedVars.asReversed()) {
|
||||
lambda.originalBoundReceiverType?.let {
|
||||
// The receiver is the only captured value; it needs to be boxed.
|
||||
StackValue.onStack(it).put(captured.type, InstructionAdapter(this))
|
||||
}
|
||||
super.visitFieldInsn(
|
||||
Opcodes.PUTSTATIC,
|
||||
|
||||
Reference in New Issue
Block a user