Request for review:8021948:Change InstanceKlass::_source_file_name and _generic_signature from Symbol* to constant pool index

Jiangli Zhou jiangli.zhou at oracle.com
Thu Aug 22 10:27:55 PDT 2013


Hi Staffan,

 From the log in JDK-8023547. I see the new_source_file_name_idx became 
0. We probably need to check the new index and only rewrite the source 
file name index if not 0.

-Sending cmd:  cont
--Sending cmd:  redefine shtest 
/Users/staffan/mercurial/hotspot-rt-jdk/JTwork/classes/com/sun/jdi/aa44598/vers2/shtest.class
rewrite_cp_refs scratch_class->source_file_name_index()=41
new_source_file_name_idx=0*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*
--Sending cmd:  stop at shtest:22

I haven't confirmed if that's the case, still trying to figure out how 
to run com/sun/jdi/RedefineMulti.sh. Do you want to give the following 
patch a try to see if it fix the problem? Also, do you have any 
instruction for how to run RedefineMulti.sh?

--- a/src/share/vm/prims/jvmtiRedefineClasses.cpp
+++ b/src/share/vm/prims/jvmtiRedefineClasses.cpp
@@ -1554,18 +1554,22 @@
      return false;
    }

-  // rewrite sourc file name index:
+  // rewrite source file name index:
    u2 source_file_name_idx = scratch_class->source_file_name_index();
    if (source_file_name_idx != 0) {
      u2 new_source_file_name_idx = find_new_index(source_file_name_idx);
- scratch_class->set_source_file_name_index(new_source_file_name_idx);
+    if (new_source_file_name_idx != 0) {
+ scratch_class->set_source_file_name_index(new_source_file_name_idx);
+    }
    }

    // rewrite class generic signature index:
    u2 generic_signature_index = scratch_class->generic_signature_index();
    if (generic_signature_index != 0) {
      u2 new_generic_signature_index = 
find_new_index(generic_signature_index);
- scratch_class->set_generic_signature_index(new_generic_signature_index);
+    if (new_generic_signature_index != 0) {
+ scratch_class->set_generic_signature_index(new_generic_signature_index);
+    }
    }


Thanks!

Jiangli

On 08/22/2013 04:09 AM, Staffan Larsen wrote:
> This changed caused com/sun/jdi/RedefineMulti.sh to fail. 
> See JDK-8023547. I'm looking at it, but if someone sees the problem, 
> let me know.
>
> /Staffan
>
> On 12 aug 2013, at 22:45, Jiangli Zhou <jiangli.zhou at oracle.com 
> <mailto:jiangli.zhou at oracle.com>> wrote:
>
>> Hi Ioi,
>>
>> Thanks for the review! I'll try those tests also.
>>
>> Thanks,
>> Jiangli
>>
>> On 08/12/2013 11:09 AM, Ioi Lam wrote:
>>> Looks good.
>>>
>>> Since you're touching the class loader code, maybe you should run 
>>> vm.parallel_class_loading.testlist as well.
>>>
>>> Thanks
>>> - Ioi
>>>
>>> On 08/09/2013 02:22 PM, Jiangli Zhou wrote:
>>>> Hi,
>>>>
>>>> Could anyone help me review this?
>>>>
>>>> Thanks,
>>>> Jiangli
>>>>
>>>> On 07/31/2013 01:51 PM, Jiangli Zhou wrote:
>>>>> Hi,
>>>>>
>>>>> Please review following change for JDK-8021948 
>>>>> <https://jbs.oracle.com/bugs/browse/JDK-8021948>:
>>>>>
>>>>> http://cr.openjdk.java.net/~jiangli/8021948/webrev.00/
>>>>>
>>>>> Both InstanceKlass::_source_file_name and 
>>>>> InstanceKlass::_generic_signature were pointers to Symbol. They 
>>>>> are now indexes to constant pool entries. Both fields are now u2 
>>>>> type, and co-located with other non-pointer type fields for more 
>>>>> efficient alignment on 64-bit machine. On 32-bit machine, the 
>>>>> change saves 4bytes for each class.
>>>>>
>>>>> Tested with JPRT, vm.quick.testlist, nsk.sajdi.testlist, 
>>>>> nsk.stress.testlist and nsk.jvmti.testlist.
>>>>>
>>>>> Thanks,
>>>>> Jiangli
>>>>
>>>
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20130822/68916c08/attachment-0001.html 


More information about the hotspot-runtime-dev mailing list