JDK-8222841 has added code to reset the Method* for CompiledStaticCalls when the call target class is no longer alive.
However, this should not happen in a healthy VM. If a static call (or optimized virtual call) is reachable then the callee class can’t be dead.
Removing this code piece of JDK-8222841 and running lots of tests did not reveal any problem.
The code was implemented for x86 on which the CompiledStaticCalls embed the Method* into the code stream and don't use the oop recorder for it.
Other platforms (e.g. PPC64, AArch64) allocate a metadata slot via oop recorder. The code in question clears the slot in the metadata section, not the replicated value which is actually used by the code. Note that fix_metadata_relocation() does nothing on most platforms! This is a further indication that the code is not needed.
In addition, the Method* null checks in the c2i entry barriers should not be needed.
We should consider reverting the unneeded parts of JDK-8222841 and run all related tests.