8008511: JSR 292: MemberName vmtarget refs to methods must be updated at class redefinition

Lazily create and maintain the MemberNameTable to be able to update MemberName's

Reviewed-by: coleenp, jrose, dholmes
This commit is contained in:
Serguei Spitsyn 2013-04-20 04:07:08 -07:00 committed by Serguei Spitsyn
parent 46b3969016
commit 87f3086e13
9 changed files with 231 additions and 58 deletions

View file

@ -2329,6 +2329,12 @@ void InstanceKlass::release_C_heap_structures() {
FreeHeap(jmeths);
}
MemberNameTable* mnt = member_names();
if (mnt != NULL) {
delete mnt;
set_member_names(NULL);
}
int* indices = methods_cached_itable_indices_acquire();
if (indices != (int*)NULL) {
release_set_methods_cached_itable_indices(NULL);
@ -2757,6 +2763,17 @@ nmethod* InstanceKlass::lookup_osr_nmethod(Method* const m, int bci, int comp_le
return NULL;
}
void InstanceKlass::add_member_name(Handle mem_name) {
jweak mem_name_wref = JNIHandles::make_weak_global(mem_name);
MutexLocker ml(MemberNameTable_lock);
DEBUG_ONLY(No_Safepoint_Verifier nsv);
if (_member_names == NULL) {
_member_names = new (ResourceObj::C_HEAP, mtClass) MemberNameTable();
}
_member_names->add_member_name(mem_name_wref);
}
// -----------------------------------------------------------------------------------------------------
// Printing