At least Adapters access GC barriers when resolving weak CLDs, see for example BarrierSetAssembler::c2i_entry_barrier:
void BarrierSetAssembler::c2i_entry_barrier(MacroAssembler* masm) {
...
// Is it a weak but alive CLD?
__ movptr(tmp1, Address(tmp1, ClassLoaderData::holder_offset()));
__ resolve_weak_handle(tmp1, tmp2); // <--- HERE
__ cmpptr(tmp1, 0);
__ jcc(Assembler::notEqual, method_live);
...
}
```
Which gets awkward when AOT saves the adapter in AOT cache. So we may end up generating the GC barrier for GC at the time of AOT cache dump, which might not be the same as the GC at runtime. We need to mechanically check this, and possibly disable storing the adapters for a while...
void BarrierSetAssembler::c2i_entry_barrier(MacroAssembler* masm) {
...
// Is it a weak but alive CLD?
__ movptr(tmp1, Address(tmp1, ClassLoaderData::holder_offset()));
__ resolve_weak_handle(tmp1, tmp2); // <--- HERE
__ cmpptr(tmp1, 0);
__ jcc(Assembler::notEqual, method_live);
...
}
```
Which gets awkward when AOT saves the adapter in AOT cache. So we may end up generating the GC barrier for GC at the time of AOT cache dump, which might not be the same as the GC at runtime. We need to mechanically check this, and possibly disable storing the adapters for a while...
- caused by
-
JDK-8350209 Preserve adapters in AOT cache
-
- Resolved
-