[9] RFR: 8152207: Perform array bound checks while getting a length of bytecode instructions

Artem Smotrakov artem.smotrakov at oracle.com
Fri May 20 20:05:35 UTC 2016


Hello,

Could someone review this fix, please?

http://cr.openjdk.java.net/~asmotrak/8152207/hotspot/webrev.01/
http://cr.openjdk.java.net/~asmotrak/8152207/jdk/webrev.00/

Artem

On 05/10/2016 01:49 PM, Artem Smotrakov wrote:
> Hi Christian,
>
> Thank you for review. Here is updated webrev
>
> http://cr.openjdk.java.net/~asmotrak/8152207/hotspot/webrev.01/
>
> Artem
>
> On 05/09/2016 01:24 PM, Christian Thalinger wrote:
>>
>>> On May 4, 2016, at 1:48 PM, Artem Smotrakov 
>>> <artem.smotrakov at oracle.com <mailto:artem.smotrakov at oracle.com>> wrote:
>>>
>>> Hello,
>>>
>>> Please review two small patches for jdk and hotspot repos which add 
>>> array bound checks to functions which return a length of bytecode 
>>> instruction.
>>>
>>> Please see details in https://bugs.openjdk.java.net/browse/JDK-8152207
>>>
>>> http://cr.openjdk.java.net/~asmotrak/8152207/jdk/webrev.00/ 
>>> <http://cr.openjdk.java.net/%7Easmotrak/8152207/jdk/webrev.00/>
>>> http://cr.openjdk.java.net/~asmotrak/8152207/hotspot/webrev.00/
>>
>> static bool        is_defined     (int  code)    { return 0 <= code 
>> && code < number_of_codes && flags(code, false) != 0; }
>> + static int length_for (Code code) { return 0 <= code && code < 
>> number_of_codes ? _lengths[code] & 0xF : -1; }
>> + static int wide_length_for(Code code) { return 0 <= code && code < 
>> number_of_codes ? _lengths[code] >> 4 : -1; }
>> You should factor the bound check into a separate method.
>>
>>>
>>> Artem
>>
>



More information about the hotspot-runtime-dev mailing list