SerialHeap::must_clear_all_soft_refs determines whether soft refs should be cleared or not, based on gc-cause.
Therefore, the Serial specific part can be removed.
```
#if INCLUDE_G1GC || INCLUDE_SERIALGC
if (UseG1GC || UseSerialGC) {
// Needs to be cleared explicitly for G1 and Serial GC.
Universe::heap()->soft_ref_policy()->set_should_clear_all_soft_refs(false);
}
#endif // INCLUDE_G1GC || INCLUDE_SERIALGC
WB_END
```
Therefore, the Serial specific part can be removed.
```
#if INCLUDE_G1GC || INCLUDE_SERIALGC
if (UseG1GC || UseSerialGC) {
// Needs to be cleared explicitly for G1 and Serial GC.
Universe::heap()->soft_ref_policy()->set_should_clear_all_soft_refs(false);
}
#endif // INCLUDE_G1GC || INCLUDE_SERIALGC
WB_END
```
- links to
-
Review(master) openjdk/jdk/26528