RFR: 8073108: GHASH Intrinsics

Vladimir Kozlov vladimir.kozlov at oracle.com
Tue Feb 17 21:14:49 UTC 2015


Florian's concern is valid.

"Range check elimination" means that C2 moves checks from a loop. Checks 
are still present. Since 'state' array is not final we can't eliminate 
range check. An other thing is an additional indirect load to access 
arrays elements.

I would suggest to keep original code for 'subkey' and 'state' which use 
separate values instead of arrays.

Regards,
Vladimir


On 2/17/15 1:00 PM, Anthony Scarpino wrote:
> On 02/17/2015 12:05 PM, Florian Weimer wrote:
>> On 02/17/2015 08:59 PM, Anthony Scarpino wrote:
>>> On 02/17/2015 12:57 AM, Florian Weimer wrote:
>>>> On 02/16/2015 10:11 PM, Anthony Scarpino wrote:
>>>>> http://cr.openjdk.java.net/~ascarpino/8073108/jdk/webrev/
>>>>
>>>> I think the “state” field in GHASH should be final.  Is C2 able to
>>>> eliminate the array bounds checks?  (Although it's not in the inner
>>>> loop
>>>> and thus probably not relevant for performance.)
>>>
>>> I'm not sure want you asking about in regard to the bounds checking? Are
>>> you asking about checking the bounds of "state"?
>>
>> state[0] and state[1]—I wonder if those expressions need array bounds
>> checks when compiled.
>
> The glossary says C2 eliminates array range checking.
> http://openjdk.java.net/groups/hotspot/docs/HotSpotGlossary.html
>
> Tony
>



More information about the security-dev mailing list