RFR: 8000818: SA constant pool need to reference to reference map after permgen removal

Yumin Qi yumin.qi at oracle.com
Wed Oct 17 23:29:52 PDT 2012


Serguei,

Line 91, 92 are same, when used after here, they are cast to short and 
byte according format "JJ" or "j".
for 78 and 79, we need to get accurate index, so need to mask 
corresponding upper bytes since we do not need to check format .  If you 
check usage after line number 91,92, you will find they are treated same 
as 78,79.

I will add _invokehandle since it got missed after permgen removal, 
Coleen pointed out this.
Will send webrev tomorrow.

Thanks
Yumin

On 10/17/2012 10:06 PM, serguei.spitsyn at oracle.com wrote:
> Hi Yumin,
>
> I've got another question related to masking.
> No consistency between methods getConstantPoolIndexFromRefMap and 
> getConstantPoolIndex.
> Compare the lines 78+79 with 91+92:
>    74     protected short getConstantPoolIndexFromRefMap(int rawcode, int bci) {
>    75         int refIndex;
>    76         String fmt = Bytecodes.format(rawcode);
>    77         switch (fmt.length()) {
>    78             case 2: refIndex =0xFF&  method.getBytecodeByteArg(bci); break;
>    79             case 3: refIndex =0xFFFF&  bytes.swapShort(method.getBytecodeShortArg(bci)); break;
>    . . .
>    86     protected short getConstantPoolIndex(int rawcode, int bci) {
>    87        // get ConstantPool index from ConstantPoolCacheIndex at given bci
>    88        String fmt = Bytecodes.format(rawcode);
>    89        int cpCacheIndex;
>    90        switch (fmt.length()) {
>    91        case 2: cpCacheIndex = method.getBytecodeByteArg(bci); break;
>    92        case 3: cpCacheIndex = method.getBytecodeShortArg(bci); break;
>
> The refIndex is positive so that there is no point to mask byte and short values at lines 78,79.
> Also one more question:
>    Why these functions are protected, not private?
>
> The rest looks good.
>
> Thanks,
> Serguei
>
>
> On 10/17/12 5:25 PM, Yumin Qi wrote:
>> Hi,
>>
>>   As suggested by David, I created a new  bug
>>   8001055:  Bytes.swap should follow big endian
>>   to address the issued caused by 6879063 push.
>>
>>   new webrevs:
>> http://cr.openjdk.java.net/~minqi/8000818
>> http://cr.openjdk.java.net/~minqi/8001055
>>
>> Thanks
>> Yumin
>>
>> On 10/16/2012 9:51 PM, Yumin Qi wrote:
>>> Hi, all
>>>
>>>   May I have your codereview on
>>>
>>> http://cr.openjdk.java.net/~minqi/8000818/ 
>>> <http://cr.openjdk.java.net/%7Eminqi/8000818/>
>>>
>>> 8000818: SA constant pool need to reference to reference map after 
>>> permgen removal
>>> Summary: After permgen removal, constant pool changed to put _ldc 
>>> and _ldc_w (fast_ldc and fast_ldcw) index to reference map, no 
>>> longer calculated via constant pool cache.
>>> Also, there is a mistake in 6879063: SA should use hsdis. Bytes.swap 
>>> should only check if the underlying platform is big endian  since 
>>> java code follows big endian.  Revert it back to its orginal form, 
>>> else it will fail  ClassDump.
>>>
>>> Reviewed-by:
>>> Contributed-by: yumin.qi at oracle.com
>>>
>>>
>>> Thanks
>>> Yumin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20121017/9a974a20/attachment.html 


More information about the hotspot-runtime-dev mailing list