[IR] Remove FunctionDescriptor from IrCall-like node's constructor interface
This commit is contained in:
@@ -32,7 +32,6 @@ object JsIrBuilder {
|
||||
UNDEFINED_OFFSET,
|
||||
type ?: target.owner.returnType,
|
||||
target,
|
||||
target.descriptor,
|
||||
target.descriptor.typeParametersCount,
|
||||
SYNTHESIZED_STATEMENT
|
||||
).apply {
|
||||
@@ -186,7 +185,7 @@ object JsIrBuilder {
|
||||
IrCompositeImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, type, SYNTHESIZED_STATEMENT, statements)
|
||||
|
||||
fun buildFunctionReference(type: IrType, symbol: IrFunctionSymbol) =
|
||||
IrFunctionReferenceImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, type, symbol, symbol.descriptor, 0, null)
|
||||
IrFunctionReferenceImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, type, symbol, 0, null)
|
||||
|
||||
fun buildVar(
|
||||
type: IrType,
|
||||
|
||||
-1
@@ -92,7 +92,6 @@ class CallableReferenceLowering(val context: JsIrBackendContext) : FileLoweringP
|
||||
callable.startOffset, callable.endOffset,
|
||||
newTarget.symbol.owner.returnType,
|
||||
newTarget.symbol,
|
||||
newTarget.symbol.descriptor,
|
||||
callable.origin
|
||||
).apply {
|
||||
copyTypeArgumentsFrom(callable)
|
||||
|
||||
-2
@@ -79,7 +79,6 @@ class JsDefaultCallbackGenerator(val context: JsIrBackendContext): BodyLoweringP
|
||||
endOffset,
|
||||
context.irBuiltIns.anyType,
|
||||
originalFunction.symbol,
|
||||
originalFunction.descriptor,
|
||||
0,
|
||||
BIND_CALL
|
||||
)
|
||||
@@ -91,7 +90,6 @@ class JsDefaultCallbackGenerator(val context: JsIrBackendContext): BodyLoweringP
|
||||
endOffset,
|
||||
context.irBuiltIns.anyType,
|
||||
context.intrinsics.jsBind.symbol,
|
||||
context.intrinsics.jsBind.descriptor,
|
||||
BIND_CALL,
|
||||
superQualifierSymbol
|
||||
)
|
||||
|
||||
+3
-5
@@ -82,9 +82,8 @@ class PrivateMembersLowering(val context: JsIrBackendContext) : FileLoweringPass
|
||||
IrFunctionReferenceImpl(
|
||||
expression.startOffset, expression.endOffset,
|
||||
expression.type,
|
||||
it.symbol, it.descriptor,
|
||||
expression.typeArgumentsCount, expression.valueArgumentsCount,
|
||||
expression.origin
|
||||
it.symbol, expression.typeArgumentsCount,
|
||||
expression.valueArgumentsCount, expression.origin
|
||||
)
|
||||
}
|
||||
} ?: expression
|
||||
@@ -113,8 +112,7 @@ class PrivateMembersLowering(val context: JsIrBackendContext) : FileLoweringPass
|
||||
val newExpression = IrCallImpl(
|
||||
expression.startOffset, expression.endOffset,
|
||||
expression.type,
|
||||
staticTarget.symbol, staticTarget.descriptor,
|
||||
expression.typeArgumentsCount,
|
||||
staticTarget.symbol, expression.typeArgumentsCount,
|
||||
expression.origin,
|
||||
expression.superQualifierSymbol
|
||||
)
|
||||
|
||||
-2
@@ -75,7 +75,6 @@ private class ScriptRemoveReceiverLowering(val context: CommonBackendContext) :
|
||||
type.annotations
|
||||
),
|
||||
symbol,
|
||||
descriptor,
|
||||
typeArgumentsCount,
|
||||
valueArgumentsCount,
|
||||
origin
|
||||
@@ -111,7 +110,6 @@ private class ScriptRemoveReceiverLowering(val context: CommonBackendContext) :
|
||||
type.annotations
|
||||
),
|
||||
symbol,
|
||||
descriptor,
|
||||
typeArgumentsCount,
|
||||
field,
|
||||
getter,
|
||||
|
||||
+1
-1
@@ -238,7 +238,7 @@ private class CallsiteRedirectionTransformer(context: JsIrBackendContext) : IrEl
|
||||
private fun replaceSecondaryConstructorWithFactoryFunction(
|
||||
call: IrFunctionAccessExpression,
|
||||
newTarget: IrSimpleFunctionSymbol
|
||||
) = IrCallImpl(call.startOffset, call.endOffset, call.type, newTarget, newTarget.descriptor, call.typeArgumentsCount).apply {
|
||||
) = IrCallImpl(call.startOffset, call.endOffset, call.type, newTarget, call.typeArgumentsCount).apply {
|
||||
|
||||
copyTypeArgumentsFrom(call)
|
||||
|
||||
|
||||
+2
-9
@@ -6,23 +6,16 @@
|
||||
package org.jetbrains.kotlin.ir.backend.js.lower
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.FileLoweringPass
|
||||
import org.jetbrains.kotlin.backend.common.lower.callsSuper
|
||||
import org.jetbrains.kotlin.ir.IrStatement
|
||||
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
|
||||
import org.jetbrains.kotlin.ir.backend.js.JsIrBackendContext
|
||||
import org.jetbrains.kotlin.ir.backend.js.ir.JsIrBuilder
|
||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||
import org.jetbrains.kotlin.ir.declarations.IrConstructor
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclarationParent
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFile
|
||||
import org.jetbrains.kotlin.ir.expressions.*
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.*
|
||||
import org.jetbrains.kotlin.ir.types.isNullableString
|
||||
import org.jetbrains.kotlin.ir.types.isString
|
||||
import org.jetbrains.kotlin.ir.types.makeNotNull
|
||||
import org.jetbrains.kotlin.ir.util.defaultType
|
||||
import org.jetbrains.kotlin.ir.util.isThrowable
|
||||
import org.jetbrains.kotlin.ir.util.isThrowableTypeOrSubtype
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
|
||||
|
||||
@@ -74,7 +67,7 @@ class ThrowableLowering(val context: JsIrBackendContext) : FileLoweringPass {
|
||||
val (messageArg, causeArg) = expression.extractThrowableArguments()
|
||||
|
||||
return expression.run {
|
||||
IrCallImpl(startOffset, endOffset, type, newThrowableFunction, newThrowableFunction.descriptor).also {
|
||||
IrCallImpl(startOffset, endOffset, type, newThrowableFunction).also {
|
||||
it.putValueArgument(0, messageArg)
|
||||
it.putValueArgument(1, causeArg)
|
||||
}
|
||||
@@ -91,7 +84,7 @@ class ThrowableLowering(val context: JsIrBackendContext) : FileLoweringPass {
|
||||
val thisReceiver = IrGetValueImpl(expression.startOffset, expression.endOffset, klass.thisReceiver!!.symbol)
|
||||
|
||||
return expression.run {
|
||||
IrCallImpl(startOffset, endOffset, type, extendThrowableFunction, extendThrowableFunction.descriptor).also {
|
||||
IrCallImpl(startOffset, endOffset, type, extendThrowableFunction).also {
|
||||
it.putValueArgument(0, thisReceiver)
|
||||
it.putValueArgument(1, messageArg)
|
||||
it.putValueArgument(2, causeArg)
|
||||
|
||||
Reference in New Issue
Block a user