Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,12 @@ private AssumptionResult<ResolvedJavaType> concreteSubtype(HotSpotResolvedObject
* @return true if the type is a leaf class
*/
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;
}

/**
Expand Down