hs25 review request (2nd round): 8008511 JSR 292: MemberName vmtarget refs to methods must be updated at class redefinition
serguei.spitsyn at oracle.com
serguei.spitsyn at oracle.com
Mon Apr 15 17:48:12 PDT 2013
On 4/15/13 4:48 PM, David Holmes wrote:
> On 16/04/2013 3:59 AM, serguei.spitsyn at oracle.com wrote:
>> Hi David,
>>
>>
>> Thank you for the comments!
>>
>>
>> On 4/14/13 10:12 PM, David Holmes wrote:
>>> Hi Serguei,
>>>
>>> Not a full review ...
>>>
>>> In instanceKlass.cpp:
>>>
>>> + MemberNameTable* mnt = member_names();
>>> + if (mnt != NULL) {
>>> + delete mnt;
>>> + }
>>>
>>> a) do we need to call set_member_names(null) ?
>>
>> Fixed, thanks.
>>
>>
>>> b) do we need to use the MemberNameTable_lock to guard this?
>>
>> I don't think so.
>> This deallocation must be done at a safepoint.
>> We can't grab locks at safepoints.
>
> Okay but that is only one side of things. We also have to verify that
> any code that does grab the lock can't enter a safepoint while holding
> the lock.
Thank you for checking this.
I did a check that the code that grabs the lock does not need a safepoint.
I can place a No_Safepoint_Verifier, if you think, it makes sense to do.
Currently, this is the only place that grabs the lock:
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); // <= We can add this check
if (_member_names == NULL) {
_member_names = new (ResourceObj::C_HEAP, mtClass) MemberNameTable();
}
_member_names->add_member_name(mem_name_wref);
}
Thanks,
Serguei
>
> David
> ------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20130415/62c69f67/attachment.html
More information about the serviceability-dev
mailing list