[9] RFR (XS): 8155635: C2: opaque unsafe access triggers an assert

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Thu May 5 18:48:49 UTC 2016


The following code hits an assert in 
LibraryCallKit::inline_unsafe_access() during compilation of the 
following code:

     int test(Object o) {
         return UNSAFE.getInt(o, F_OFFSET);

It baffles the compiler since such shape can be used to access both 
on-heap and off-heap memory (due to double-register addressing mode).

The proposed fix is to convert the asserts into guards which revert to 
native calls in such cases.

Testing: JPRT, RBT (hs-tier0-comp).


Best regards,
Vladimir Ivanov

More information about the hotspot-compiler-dev mailing list