TotalOrderEquals: Handle nulls

This commit is contained in:
Ting-Yuan Huang
2019-03-23 00:03:12 -07:00
committed by Dmitry Petrov
parent b1474b11f2
commit 1bf0354e35
4 changed files with 6 additions and 4 deletions
@@ -139,7 +139,12 @@ class TotalOrderEquals(operandType: Type) : IntrinsicMethod() {
): IrIntrinsicFunction =
object : IrIntrinsicFunction(expression, signature, context, listOf(boxedType, boxedType)) {
override fun genInvokeInstruction(v: InstructionAdapter) {
v.invokevirtual(boxedType.internalName, "equals", Type.getMethodDescriptor(Type.BOOLEAN_TYPE, AsmTypes.OBJECT_TYPE), false)
v.invokestatic(
IntrinsicMethods.INTRINSICS_CLASS_NAME,
"areEqual",
Type.getMethodDescriptor(Type.BOOLEAN_TYPE, AsmTypes.OBJECT_TYPE, AsmTypes.OBJECT_TYPE),
false
)
}
}
}