8321225: [JVMCI] HotSpotResolvedObjectTypeImpl.isLeafClass shouldn't create strong references
Reviewed-by: thartmann, eosterlund, kvn
This commit is contained in:
parent
640d7f31b2
commit
fddc02e046
@ -265,7 +265,12 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem
|
|||||||
* @return true if the type is a leaf class
|
* @return true if the type is a leaf class
|
||||||
*/
|
*/
|
||||||
private boolean isLeafClass() {
|
private boolean isLeafClass() {
|
||||||
return compilerToVM().getResolvedJavaType(this, config().subklassOffset, false) == null;
|
// In general, compilerToVM().getResolvedJavaType should always be used to read a Klass*
|
||||||
|
// from HotSpot data structures but that has the side effect of creating a strong reference
|
||||||
|
// to the Class which we do not want since it can cause class unloading problems. Since
|
||||||
|
// this code is only checking for null vs non-null so it should be safe to perform this
|
||||||
|
// check directly.
|
||||||
|
return UNSAFE.getLong(this.getKlassPointer() + config().subklassOffset) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user