Tests if two
object constants reference the same object.
This class is needed because different subclasses of
SubstrateObjectConstant
must be
comparable, but their
Object.equals(java.lang.Object)
methods should not and cannot (due to dependencies)
have direct knowledge of other classes, so their methods delegate to this class. This code
overlaps with
ConstantReflectionProvider.constantEquals(jdk.vm.ci.meta.Constant, jdk.vm.ci.meta.Constant)
, but existing code relies on
directly testing object equality on constants, such as the
ObjectLocationIdentity
class,
which is crucial for the alias analysis of memory accesses during compilation.