[9] RFR (S): 8155635: C2: Mixed unsafe oop accesses break alias analysis

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Wed Aug 24 18:47:00 UTC 2016


SplitIf transformation can produce untyped pointers when slitting AddP
nodes for unsafe accesses through a Phi which merges non-null & null values:
      AddP ... (Phi (ConP #NULL) (CheckCastPP Oop:...:NotNull))

LibraryCallKit::inline_unsafe_access() produces such code shape for 
mixed oop accesses.

The fix removes special case for mixed unsafe oop accesses in 
inline_unsafe_access(), so they are treated as if they are always 
on-heap. Off-heap oop accesses are dangerous and most likely crash in GC 
barriers anyway.

It's a repeated attempt to fix the bug (previous thread [1]).

Initially, I tried to convert between on-heap & raw pointers, but based 
on Vladimir K feedback decided to do a conservative fix. The only known 
problematic case is Unsafe.putObject.

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


Best regards,
Vladimir Ivanov


More information about the hotspot-compiler-dev mailing list