[JVM] Use reference comparison for objects defined in StrictBasicValue

This commit is contained in:
Ivan Kylchik
2023-09-06 16:43:40 +02:00
committed by Space Team
parent c1c04376cf
commit 2387fe302c
2 changed files with 2 additions and 2 deletions
@@ -671,7 +671,7 @@ class CoroutineTransformerMethodVisitor(
val value = frame.getLocal(slot)
if (value.type == null || (shouldOptimiseUnusedVariables && !livenessFrame.isAlive(slot))) continue
if (value == StrictBasicValue.NULL_VALUE) {
if (value === StrictBasicValue.NULL_VALUE) {
referencesToSpill += slot to null
continue
}
@@ -170,7 +170,7 @@ abstract class BoxingInterpreter(
private fun merge(v: BasicValue, w: BasicValue, isLocalVariable: Boolean) =
when {
v == StrictBasicValue.UNINITIALIZED_VALUE || w == StrictBasicValue.UNINITIALIZED_VALUE ->
v === StrictBasicValue.UNINITIALIZED_VALUE || w === StrictBasicValue.UNINITIALIZED_VALUE ->
StrictBasicValue.UNINITIALIZED_VALUE
v is BoxedBasicValue -> {
if (w is BoxedBasicValue) {