mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 23:34:52 +02:00
Merge
This commit is contained in:
commit
3c3e60d5be
58 changed files with 705 additions and 903 deletions
|
@ -2931,28 +2931,27 @@ nmethod* InstanceKlass::lookup_osr_nmethod(const Method* m, int bci, int comp_le
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void InstanceKlass::add_member_name(int index, Handle mem_name) {
|
||||
bool InstanceKlass::add_member_name(Handle mem_name) {
|
||||
jweak mem_name_wref = JNIHandles::make_weak_global(mem_name);
|
||||
MutexLocker ml(MemberNameTable_lock);
|
||||
assert(0 <= index && index < idnum_allocated_count(), "index is out of bounds");
|
||||
DEBUG_ONLY(No_Safepoint_Verifier nsv);
|
||||
|
||||
// Check if method has been redefined while taking out MemberNameTable_lock, if so
|
||||
// return false. We cannot cache obsolete methods. They will crash when the function
|
||||
// is called!
|
||||
Method* method = (Method*)java_lang_invoke_MemberName::vmtarget(mem_name());
|
||||
if (method->is_obsolete()) {
|
||||
return false;
|
||||
} else if (method->is_old()) {
|
||||
// Replace method with redefined version
|
||||
java_lang_invoke_MemberName::set_vmtarget(mem_name(), method_with_idnum(method->method_idnum()));
|
||||
}
|
||||
|
||||
if (_member_names == NULL) {
|
||||
_member_names = new (ResourceObj::C_HEAP, mtClass) MemberNameTable(idnum_allocated_count());
|
||||
}
|
||||
_member_names->add_member_name(index, mem_name_wref);
|
||||
}
|
||||
|
||||
oop InstanceKlass::get_member_name(int index) {
|
||||
MutexLocker ml(MemberNameTable_lock);
|
||||
assert(0 <= index && index < idnum_allocated_count(), "index is out of bounds");
|
||||
DEBUG_ONLY(No_Safepoint_Verifier nsv);
|
||||
|
||||
if (_member_names == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
oop mem_name =_member_names->get_member_name(index);
|
||||
return mem_name;
|
||||
_member_names->add_member_name(mem_name_wref);
|
||||
return true;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue