Skip to content

Commit 647aa2a

Browse files
committedApr 19, 2022
8284572: Remove unneeded null check in ReferenceProcessor::discover_reference
Reviewed-by: tschatzl, kbarrett
1 parent ab83bce commit 647aa2a

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed
 

‎src/hotspot/share/gc/shared/referenceProcessor.cpp

+2-7
Original file line numberDiff line numberDiff line change
@@ -828,9 +828,6 @@ inline DiscoveredList* ReferenceProcessor::get_discovered_list(ReferenceType rt)
828828
// Get the discovered queue to which we will add
829829
DiscoveredList* list = NULL;
830830
switch (rt) {
831-
case REF_OTHER:
832-
// Unknown reference type, no special treatment
833-
break;
834831
case REF_SOFT:
835832
list = &_discoveredSoftRefs[id];
836833
break;
@@ -843,6 +840,8 @@ inline DiscoveredList* ReferenceProcessor::get_discovered_list(ReferenceType rt)
843840
case REF_PHANTOM:
844841
list = &_discoveredPhantomRefs[id];
845842
break;
843+
case REF_OTHER:
844+
// Unknown reference type, impossible
846845
case REF_NONE:
847846
// we should not reach here if we are an InstanceRefKlass
848847
default:
@@ -1036,10 +1035,6 @@ bool ReferenceProcessor::discover_reference(oop obj, ReferenceType rt) {
10361035

10371036
// Get the right type of discovered queue head.
10381037
DiscoveredList* list = get_discovered_list(rt);
1039-
if (list == NULL) {
1040-
return false; // nothing special needs to be done
1041-
}
1042-
10431038
add_to_discovered_list(*list, obj, discovered_addr);
10441039

10451040
assert(oopDesc::is_oop(obj), "Discovered a bad reference");

0 commit comments

Comments
 (0)
Please sign in to comment.