JVM_IR, minor: use vals instead of objects
This commit is contained in:
+4
-4
@@ -113,10 +113,10 @@ class IrIntrinsicMethods(val irBuiltIns: IrBuiltIns, val symbols: JvmSymbols) {
|
|||||||
symbols.unsafeCoerceIntrinsic.toKey()!! to UnsafeCoerce,
|
symbols.unsafeCoerceIntrinsic.toKey()!! to UnsafeCoerce,
|
||||||
symbols.signatureStringIntrinsic.toKey()!! to SignatureString,
|
symbols.signatureStringIntrinsic.toKey()!! to SignatureString,
|
||||||
symbols.reassignParameterIntrinsic.toKey()!! to ReassignParameter,
|
symbols.reassignParameterIntrinsic.toKey()!! to ReassignParameter,
|
||||||
symbols.throwNullPointerException.toKey() to ThrowNullPointerException,
|
symbols.throwNullPointerException.toKey()!! to ThrowException(Type.getObjectType("java/lang/NullPointerException")),
|
||||||
symbols.throwTypeCastException.toKey() to ThrowTypeCastException,
|
symbols.throwTypeCastException.toKey()!! to ThrowException(Type.getObjectType("kotlin/TypeCastException")),
|
||||||
symbols.throwUnsupportedOperationException.toKey() to ThrowUnsupportedOperationException,
|
symbols.throwUnsupportedOperationException.toKey()!! to ThrowException(Type.getObjectType("java/lang/UnsupportedOperationException")),
|
||||||
symbols.throwKotlinNothingValueException.toKey()!! to ThrowKotlinNothingValueException
|
symbols.throwKotlinNothingValueException.toKey()!! to ThrowKotlinNothingValueException,
|
||||||
) +
|
) +
|
||||||
numberConversionMethods() +
|
numberConversionMethods() +
|
||||||
unaryFunForPrimitives("plus", UnaryPlus) +
|
unaryFunForPrimitives("plus", UnaryPlus) +
|
||||||
|
|||||||
+1
-5
@@ -12,7 +12,7 @@ import org.jetbrains.kotlin.ir.expressions.IrFunctionAccessExpression
|
|||||||
import org.jetbrains.kotlin.resolve.jvm.AsmTypes
|
import org.jetbrains.kotlin.resolve.jvm.AsmTypes
|
||||||
import org.jetbrains.org.objectweb.asm.Type
|
import org.jetbrains.org.objectweb.asm.Type
|
||||||
|
|
||||||
abstract class ThrowException(val exceptionClass: Type) : IntrinsicMethod() {
|
class ThrowException(val exceptionClass: Type) : IntrinsicMethod() {
|
||||||
override fun invoke(expression: IrFunctionAccessExpression, codegen: ExpressionCodegen, data: BlockInfo): PromisedValue? {
|
override fun invoke(expression: IrFunctionAccessExpression, codegen: ExpressionCodegen, data: BlockInfo): PromisedValue? {
|
||||||
with(codegen) {
|
with(codegen) {
|
||||||
mv.anew(exceptionClass)
|
mv.anew(exceptionClass)
|
||||||
@@ -25,7 +25,3 @@ abstract class ThrowException(val exceptionClass: Type) : IntrinsicMethod() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
object ThrowNullPointerException : ThrowException(Type.getObjectType("java/lang/NullPointerException"))
|
|
||||||
object ThrowTypeCastException : ThrowException(Type.getObjectType("kotlin/TypeCastException"))
|
|
||||||
object ThrowUnsupportedOperationException : ThrowException(Type.getObjectType("java/lang/UnsupportedOperationException"))
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user