diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/interpreter/builtins/IrBuiltInsMapGenerated.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/interpreter/builtins/IrBuiltInsMapGenerated.kt index 5a56f8d8e78..465dd579f48 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/interpreter/builtins/IrBuiltInsMapGenerated.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/interpreter/builtins/IrBuiltInsMapGenerated.kt @@ -21,8 +21,11 @@ import org.jetbrains.kotlin.backend.common.interpreter.stack.* /** This file is generated by org.jetbrains.kotlin.backend.common.interpreter.builtins.GenerateBuiltInsMap.generateMap(). DO NOT MODIFY MANUALLY */ val unaryFunctions = mapOf>( + unaryOperation("hashCode", "Boolean") { a -> a.hashCode() }, unaryOperation("not", "Boolean") { a -> a.not() }, + unaryOperation("toString", "Boolean") { a -> a.toString() }, unaryOperation("dec", "Char") { a -> a.dec() }, + unaryOperation("hashCode", "Char") { a -> a.hashCode() }, unaryOperation("inc", "Char") { a -> a.inc() }, unaryOperation("toByte", "Char") { a -> a.toByte() }, unaryOperation("toChar", "Char") { a -> a.toChar() }, @@ -31,7 +34,9 @@ val unaryFunctions = mapOf>( unaryOperation("toInt", "Char") { a -> a.toInt() }, unaryOperation("toLong", "Char") { a -> a.toLong() }, unaryOperation("toShort", "Char") { a -> a.toShort() }, + unaryOperation("toString", "Char") { a -> a.toString() }, unaryOperation("dec", "Byte") { a -> a.dec() }, + unaryOperation("hashCode", "Byte") { a -> a.hashCode() }, unaryOperation("inc", "Byte") { a -> a.inc() }, unaryOperation("toByte", "Byte") { a -> a.toByte() }, unaryOperation("toChar", "Byte") { a -> a.toChar() }, @@ -40,9 +45,11 @@ val unaryFunctions = mapOf>( unaryOperation("toInt", "Byte") { a -> a.toInt() }, unaryOperation("toLong", "Byte") { a -> a.toLong() }, unaryOperation("toShort", "Byte") { a -> a.toShort() }, + unaryOperation("toString", "Byte") { a -> a.toString() }, unaryOperation("unaryMinus", "Byte") { a -> a.unaryMinus() }, unaryOperation("unaryPlus", "Byte") { a -> a.unaryPlus() }, unaryOperation("dec", "Short") { a -> a.dec() }, + unaryOperation("hashCode", "Short") { a -> a.hashCode() }, unaryOperation("inc", "Short") { a -> a.inc() }, unaryOperation("toByte", "Short") { a -> a.toByte() }, unaryOperation("toChar", "Short") { a -> a.toChar() }, @@ -51,9 +58,11 @@ val unaryFunctions = mapOf>( unaryOperation("toInt", "Short") { a -> a.toInt() }, unaryOperation("toLong", "Short") { a -> a.toLong() }, unaryOperation("toShort", "Short") { a -> a.toShort() }, + unaryOperation("toString", "Short") { a -> a.toString() }, unaryOperation("unaryMinus", "Short") { a -> a.unaryMinus() }, unaryOperation("unaryPlus", "Short") { a -> a.unaryPlus() }, unaryOperation("dec", "Int") { a -> a.dec() }, + unaryOperation("hashCode", "Int") { a -> a.hashCode() }, unaryOperation("inc", "Int") { a -> a.inc() }, unaryOperation("inv", "Int") { a -> a.inv() }, unaryOperation("toByte", "Int") { a -> a.toByte() }, @@ -63,9 +72,11 @@ val unaryFunctions = mapOf>( unaryOperation("toInt", "Int") { a -> a.toInt() }, unaryOperation("toLong", "Int") { a -> a.toLong() }, unaryOperation("toShort", "Int") { a -> a.toShort() }, + unaryOperation("toString", "Int") { a -> a.toString() }, unaryOperation("unaryMinus", "Int") { a -> a.unaryMinus() }, unaryOperation("unaryPlus", "Int") { a -> a.unaryPlus() }, unaryOperation("dec", "Float") { a -> a.dec() }, + unaryOperation("hashCode", "Float") { a -> a.hashCode() }, unaryOperation("inc", "Float") { a -> a.inc() }, unaryOperation("toByte", "Float") { a -> a.toByte() }, unaryOperation("toChar", "Float") { a -> a.toChar() }, @@ -74,9 +85,11 @@ val unaryFunctions = mapOf>( unaryOperation("toInt", "Float") { a -> a.toInt() }, unaryOperation("toLong", "Float") { a -> a.toLong() }, unaryOperation("toShort", "Float") { a -> a.toShort() }, + unaryOperation("toString", "Float") { a -> a.toString() }, unaryOperation("unaryMinus", "Float") { a -> a.unaryMinus() }, unaryOperation("unaryPlus", "Float") { a -> a.unaryPlus() }, unaryOperation("dec", "Long") { a -> a.dec() }, + unaryOperation("hashCode", "Long") { a -> a.hashCode() }, unaryOperation("inc", "Long") { a -> a.inc() }, unaryOperation("inv", "Long") { a -> a.inv() }, unaryOperation("toByte", "Long") { a -> a.toByte() }, @@ -86,9 +99,11 @@ val unaryFunctions = mapOf>( unaryOperation("toInt", "Long") { a -> a.toInt() }, unaryOperation("toLong", "Long") { a -> a.toLong() }, unaryOperation("toShort", "Long") { a -> a.toShort() }, + unaryOperation("toString", "Long") { a -> a.toString() }, unaryOperation("unaryMinus", "Long") { a -> a.unaryMinus() }, unaryOperation("unaryPlus", "Long") { a -> a.unaryPlus() }, unaryOperation("dec", "Double") { a -> a.dec() }, + unaryOperation("hashCode", "Double") { a -> a.hashCode() }, unaryOperation("inc", "Double") { a -> a.inc() }, unaryOperation("toByte", "Double") { a -> a.toByte() }, unaryOperation("toChar", "Double") { a -> a.toChar() }, @@ -97,6 +112,7 @@ val unaryFunctions = mapOf>( unaryOperation("toInt", "Double") { a -> a.toInt() }, unaryOperation("toLong", "Double") { a -> a.toLong() }, unaryOperation("toShort", "Double") { a -> a.toShort() }, + unaryOperation("toString", "Double") { a -> a.toString() }, unaryOperation("unaryMinus", "Double") { a -> a.unaryMinus() }, unaryOperation("unaryPlus", "Double") { a -> a.unaryPlus() }, unaryOperation("length", "String") { a -> a.length }, @@ -128,9 +144,11 @@ val unaryFunctions = mapOf>( val binaryFunctions = mapOf>( binaryOperation("and", "Boolean", "Boolean") { a, b -> a.and(b) }, binaryOperation("compareTo", "Boolean", "Boolean") { a, b -> a.compareTo(b) }, + binaryOperation("equals", "Boolean", "Any?") { a, b -> a.equals(b) }, binaryOperation("or", "Boolean", "Boolean") { a, b -> a.or(b) }, binaryOperation("xor", "Boolean", "Boolean") { a, b -> a.xor(b) }, binaryOperation("compareTo", "Char", "Char") { a, b -> a.compareTo(b) }, + binaryOperation("equals", "Char", "Any?") { a, b -> a.equals(b) }, binaryOperation("minus", "Char", "Char") { a, b -> a.minus(b) }, binaryOperation("minus", "Char", "Int") { a, b -> a.minus(b) }, binaryOperation("plus", "Char", "Int") { a, b -> a.plus(b) }, @@ -147,6 +165,7 @@ val binaryFunctions = mapOf>( binaryOperation("div", "Byte", "Int") { a, b -> a.div(b) }, binaryOperation("div", "Byte", "Long") { a, b -> a.div(b) }, binaryOperation("div", "Byte", "Short") { a, b -> a.div(b) }, + binaryOperation("equals", "Byte", "Any?") { a, b -> a.equals(b) }, binaryOperation("minus", "Byte", "Byte") { a, b -> a.minus(b) }, binaryOperation("minus", "Byte", "Double") { a, b -> a.minus(b) }, binaryOperation("minus", "Byte", "Float") { a, b -> a.minus(b) }, @@ -187,6 +206,7 @@ val binaryFunctions = mapOf>( binaryOperation("div", "Short", "Int") { a, b -> a.div(b) }, binaryOperation("div", "Short", "Long") { a, b -> a.div(b) }, binaryOperation("div", "Short", "Short") { a, b -> a.div(b) }, + binaryOperation("equals", "Short", "Any?") { a, b -> a.equals(b) }, binaryOperation("minus", "Short", "Byte") { a, b -> a.minus(b) }, binaryOperation("minus", "Short", "Double") { a, b -> a.minus(b) }, binaryOperation("minus", "Short", "Float") { a, b -> a.minus(b) }, @@ -228,6 +248,7 @@ val binaryFunctions = mapOf>( binaryOperation("div", "Int", "Int") { a, b -> a.div(b) }, binaryOperation("div", "Int", "Long") { a, b -> a.div(b) }, binaryOperation("div", "Int", "Short") { a, b -> a.div(b) }, + binaryOperation("equals", "Int", "Any?") { a, b -> a.equals(b) }, binaryOperation("minus", "Int", "Byte") { a, b -> a.minus(b) }, binaryOperation("minus", "Int", "Double") { a, b -> a.minus(b) }, binaryOperation("minus", "Int", "Float") { a, b -> a.minus(b) }, @@ -273,6 +294,7 @@ val binaryFunctions = mapOf>( binaryOperation("div", "Float", "Int") { a, b -> a.div(b) }, binaryOperation("div", "Float", "Long") { a, b -> a.div(b) }, binaryOperation("div", "Float", "Short") { a, b -> a.div(b) }, + binaryOperation("equals", "Float", "Any?") { a, b -> a.equals(b) }, binaryOperation("minus", "Float", "Byte") { a, b -> a.minus(b) }, binaryOperation("minus", "Float", "Double") { a, b -> a.minus(b) }, binaryOperation("minus", "Float", "Float") { a, b -> a.minus(b) }, @@ -310,6 +332,7 @@ val binaryFunctions = mapOf>( binaryOperation("div", "Long", "Int") { a, b -> a.div(b) }, binaryOperation("div", "Long", "Long") { a, b -> a.div(b) }, binaryOperation("div", "Long", "Short") { a, b -> a.div(b) }, + binaryOperation("equals", "Long", "Any?") { a, b -> a.equals(b) }, binaryOperation("minus", "Long", "Byte") { a, b -> a.minus(b) }, binaryOperation("minus", "Long", "Double") { a, b -> a.minus(b) }, binaryOperation("minus", "Long", "Float") { a, b -> a.minus(b) }, @@ -355,6 +378,7 @@ val binaryFunctions = mapOf>( binaryOperation("div", "Double", "Int") { a, b -> a.div(b) }, binaryOperation("div", "Double", "Long") { a, b -> a.div(b) }, binaryOperation("div", "Double", "Short") { a, b -> a.div(b) }, + binaryOperation("equals", "Double", "Any?") { a, b -> a.equals(b) }, binaryOperation("minus", "Double", "Byte") { a, b -> a.minus(b) }, binaryOperation("minus", "Double", "Double") { a, b -> a.minus(b) }, binaryOperation("minus", "Double", "Float") { a, b -> a.minus(b) }, diff --git a/generators/evaluate/GenerateBuiltInsMap.kt b/generators/evaluate/GenerateBuiltInsMap.kt index 88bb3dd83fb..dd08bfa6cd1 100644 --- a/generators/evaluate/GenerateBuiltInsMap.kt +++ b/generators/evaluate/GenerateBuiltInsMap.kt @@ -8,6 +8,7 @@ package org.jetbrains.kotlin.generators.evaluate import org.jetbrains.kotlin.backend.common.interpreter.builtins.compileTimeAnnotation import org.jetbrains.kotlin.backend.jvm.serialization.JvmIdSignatureDescriptor import org.jetbrains.kotlin.builtins.DefaultBuiltIns +import org.jetbrains.kotlin.builtins.KotlinBuiltIns import org.jetbrains.kotlin.builtins.PrimitiveType import org.jetbrains.kotlin.config.ApiVersion import org.jetbrains.kotlin.config.LanguageVersion @@ -88,8 +89,14 @@ private fun getOperationMap(argumentsCount: Int): MutableMap thisIsCompileTime || classIsCompileTime + else -> !isFakeOverridden && (thisIsCompileTime || classIsCompileTime) + } } for (classDescriptor in allPrimitiveTypes + builtIns.string + arrays + builtIns.any) {