This null check was added in JDK-8059924
https://github.com/openjdk/jdk/blame/f52d35c84b7333809156d201c866793854143888/src/hotspot/share/classfile/verifier.cpp#L159-L170
if (klass->java_mirror() != NULL) {
klass->java_mirror()->identity_hash();
}
However, class verification happens only during class linking. At this point, all classes should have a valid mirror.
I tested with "java -Xshare:off -Xverify:all". Evern "early" classes link java.lang.Object have a non-null mirror when they are verified.
The null check implies that we could pass a null pointer into the inference verifier, causing a subsequent crash. But this will never happen in reality.
The null check should be removed with an assert to avoid the confusion.
https://github.com/openjdk/jdk/blame/f52d35c84b7333809156d201c866793854143888/src/hotspot/share/classfile/verifier.cpp#L159-L170
if (klass->java_mirror() != NULL) {
klass->java_mirror()->identity_hash();
}
However, class verification happens only during class linking. At this point, all classes should have a valid mirror.
I tested with "java -Xshare:off -Xverify:all". Evern "early" classes link java.lang.Object have a non-null mirror when they are verified.
The null check implies that we could pass a null pointer into the inference verifier, causing a subsequent crash. But this will never happen in reality.
The null check should be removed with an assert to avoid the confusion.