[K/N] Normalize on nan values in code generator

^KT-56041
This commit is contained in:
Pavel Kunyavskiy
2023-07-27 14:37:34 +02:00
committed by Space Team
parent 6417f6456f
commit 858f432807
6 changed files with 21 additions and 13 deletions
@@ -15,7 +15,6 @@ import org.jetbrains.kotlin.platform.TargetPlatform
* 'true' - interpreter will construct object and initialize its properties despite the fact it is not marked as compile time;
* 'false' - interpreter will create a representation of empty object, that can be used to get const properties
* @param inlineConstVal tell the interpreter that value of const property can be inlined instead of getter call
* @param inlineNanVal allows to inline values of `Double.NaN` and `Float.NaN`
*/
// TODO maybe create some sort of builder
data class IrInterpreterConfiguration(
@@ -26,5 +25,4 @@ data class IrInterpreterConfiguration(
val printOnlyExceptionMessage: Boolean = false,
val collapseStackTraceFromJDK: Boolean = true,
val inlineConstVal: Boolean = true,
val inlineNanVal: Boolean = true,
)
@@ -122,9 +122,6 @@ class IrInterpreterCommonChecker : IrInterpreterChecker {
}
override fun visitConst(expression: IrConst<*>, data: IrInterpreterCheckerData): Boolean {
if (!data.interpreterConfiguration.inlineNanVal) {
return !expression.isNaN()
}
return true
}