8028497: SIGSEGV at ClassLoaderData::oops_do(OopClosure*, KlassClosure*, bool)

Keep class in CLD::_klasses list and mirror created for CDS classes if OOM during restore_shareable_info(). This keeps pointers consistent for CMS.

Reviewed-by: ehelin, stefank, jmasa, iklam
This commit is contained in:
Coleen Phillimore 2014-04-08 13:58:38 -04:00
parent eea84b4feb
commit c8990959f2
14 changed files with 109 additions and 139 deletions

View file

@ -903,6 +903,19 @@ address Method::make_adapters(methodHandle mh, TRAPS) {
return adapter->get_c2i_entry();
}
void Method::restore_unshareable_info(TRAPS) {
// Since restore_unshareable_info can be called more than once for a method, don't
// redo any work. If this field is restored, there is nothing to do.
if (_from_compiled_entry == NULL) {
// restore method's vtable by calling a virtual function
restore_vtable();
methodHandle mh(THREAD, this);
link_method(mh, CHECK);
}
}
// The verified_code_entry() must be called when a invoke is resolved
// on this method.