~ gradle
diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.kt
index 23edb33..3761495 100644
--- a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.kt
+++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.kt
@@ -208,7 +208,7 @@
}
}
- protected fun rememberClosure(parameterType: Type, index: Int, lambdaInfo: LambdaInfo) {
+ protected fun rememberClosure(parameterType: Type, lambdaInfo: LambdaInfo) {
invocationParamBuilder.addNextValueParameter(parameterType, true, null).functionalArgument = lambdaInfo
}
@@ -225,7 +225,7 @@
}
}
- protected fun putArgumentToLocalVal(jvmKotlinType: JvmKotlinType, stackValue: StackValue, parameterIndex: Int, kind: ValueKind) {
+ protected fun putArgumentToLocalVal(jvmKotlinType: JvmKotlinType, stackValue: StackValue, kind: ValueKind) {
if (kind === ValueKind.DEFAULT_MASK || kind === ValueKind.METHOD_HANDLE_IN_DEFAULT) {
return processDefaultMaskOrMethodHandler(stackValue, kind)
}
diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/PsiInlineCodegen.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/PsiInlineCodegen.kt
index 038b1ac..28d08f9 100644
--- a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/PsiInlineCodegen.kt
+++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/PsiInlineCodegen.kt
@@ -153,7 +153,7 @@
} else null
val lambda = PsiExpressionLambda(ktLambda!!, state, parameter.isCrossinline, boundReceiver != null)
- rememberClosure(type, parameter.index, lambda)
+ rememberClosure(type, lambda)
closuresToGenerate += lambda
if (boundReceiver != null) {
// Has to be done immediately to preserve evaluation order.
@@ -179,7 +179,7 @@
}
override fun putValueIfNeeded(parameterType: JvmKotlinType, value: StackValue, kind: ValueKind, parameterIndex: Int) =
- putArgumentToLocalVal(parameterType, value, parameterIndex, kind)
+ putArgumentToLocalVal(parameterType, value, kind)
override fun putCapturedValueOnStack(stackValue: StackValue, valueType: Type, paramIndex: Int) =
putCapturedToLocalVal(stackValue, activeLambda!!.capturedVars[paramIndex], stackValue.kotlinType)
diff --git a/compiler/ir/backend.jvm/codegen/src/org/jetbrains/kotlin/backend/jvm/codegen/IrInlineCodegen.kt b/compiler/ir/backend.jvm/codegen/src/org/jetbrains/kotlin/backend/jvm/codegen/IrInlineCodegen.kt
index 2e58006..f1a37ee 100644
--- a/compiler/ir/backend.jvm/codegen/src/org/jetbrains/kotlin/backend/jvm/codegen/IrInlineCodegen.kt
+++ b/compiler/ir/backend.jvm/codegen/src/org/jetbrains/kotlin/backend/jvm/codegen/IrInlineCodegen.kt
@@ -92,7 +92,7 @@
val inlineLambda = argumentExpression.unwrapInlineLambda()
if (inlineLambda != null) {
val lambdaInfo = IrExpressionLambdaImpl(codegen, inlineLambda)
- rememberClosure(parameterType, irValueParameter.index, lambdaInfo)
+ rememberClosure(parameterType, lambdaInfo)
lambdaInfo.generateLambdaBody(sourceCompiler)
lambdaInfo.reference.getArgumentsWithIr().forEachIndexed { index, (_, ir) ->
val param = lambdaInfo.capturedVars[index]
@@ -146,7 +146,7 @@
}
val expectedType = JvmKotlinType(parameterType, irValueParameter.type.toIrBasedKotlinType())
- putArgumentToLocalVal(expectedType, onStack, irValueParameter.index, kind)
+ putArgumentToLocalVal(expectedType, onStack, kind)
}
}
diff --git a/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/state/reflection/KFunctionState.kt b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/state/reflection/KFunctionState.kt
index 8efee83..b4e9413 100644
--- a/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/state/reflection/KFunctionState.kt
+++ b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/state/reflection/KFunctionState.kt
@@ -59,13 +59,13 @@
val hasExtensionReceiver = irFunction.extensionReceiverParameter?.let { getField(it.symbol) } != null
environment.getCachedFunction(irFunction.symbol, hasDispatchReceiver, hasExtensionReceiver) ?: environment.setCachedFunction(
irFunction.symbol, hasDispatchReceiver, hasExtensionReceiver,
- newFunction = createInvokeFunction(irFunction, irClass, hasDispatchReceiver, hasExtensionReceiver).symbol
+ newFunction = createInvokeFunction(irFunction, irClass, hasDispatchReceiver).symbol
)
}
companion object {
private fun createInvokeFunction(
- irFunction: IrFunction, irClass: IrClass, hasDispatchReceiver: Boolean, hasExtensionReceiver: Boolean
+ irFunction: IrFunction, irClass: IrClass, hasDispatchReceiver: Boolean
): IrSimpleFunction {
val invokeFunction = irClass.declarations
.filterIsInstance<IrSimpleFunction>()
diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/ExternalDependenciesGenerator.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/ExternalDependenciesGenerator.kt
index c3a3b82..4e92543 100644
--- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/ExternalDependenciesGenerator.kt
+++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/ExternalDependenciesGenerator.kt
@@ -47,7 +47,8 @@
// We wait for the unbound to stabilize on fake overrides.
} while (unbound != prevUnbound)
} catch (ex: KotlinIrLinkerInternalException) {
- throw CompilationErrorException()
+ throw ex
+ //throw CompilationErrorException()
}
}
}
diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrBodyDeserializer.kt b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrBodyDeserializer.kt
index f8cb598..86bb981 100644
--- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrBodyDeserializer.kt
+++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrBodyDeserializer.kt
@@ -21,6 +21,7 @@
import org.jetbrains.kotlin.ir.types.*
import org.jetbrains.kotlin.ir.types.impl.*
import org.jetbrains.kotlin.ir.util.parentAsClass
+import org.jetbrains.kotlin.ir.util.toInt
import org.jetbrains.kotlin.backend.common.serialization.proto.IrBlock as ProtoBlock
import org.jetbrains.kotlin.backend.common.serialization.proto.IrBlockBody as ProtoBlockBody
import org.jetbrains.kotlin.backend.common.serialization.proto.IrBranch as ProtoBranch
@@ -163,7 +164,7 @@
proto.valueArgumentList.mapIndexed { i, arg ->
if (arg.hasExpression()) {
val expr = deserializeExpression(arg.expression)
- access.putValueArgument(i, expr)
+ access.putValueArgument(i + proto.hasExtensionReceiver().toInt(), expr)
}
}
@@ -268,9 +269,10 @@
IrCallImpl(
start, end, type,
symbol, proto.memberAccess.typeArgumentCount,
- proto.memberAccess.valueArgumentList.size,
+ proto.memberAccess.valueArgumentList.size + proto.memberAccess.hasExtensionReceiver().toInt(),
origin,
- superSymbol
+ superSymbol,
+ hasExtensionReceiver = proto.memberAccess.hasExtensionReceiver(),
)
deserializeMemberAccessCommon(call, proto.memberAccess)
return call
@@ -380,7 +382,7 @@
type,
symbol,
proto.memberAccess.typeArgumentCount,
- proto.memberAccess.valueArgumentCount,
+ proto.memberAccess.valueArgumentCount + proto.memberAccess.hasExtensionReceiver().toInt(),
reflectionTarget,
origin
)