[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


http://cr.openjdk.java.net/~vlivanov/8155635/webrev.01/
https://bugs.openjdk.java.net/browse/JDK-8155635

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).

Thanks!

Best regards,
Vladimir Ivanov

[1] 
http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2016-April/022743.html


More information about the hotspot-compiler-dev mailing list