-
Enhancement
-
Resolution: Unresolved
-
P4
-
17, 18
While fixing JDK-8270626 it was discovered that the C2 intrinsic for Reference.refersTo() is not used as often as one would think. Instead C2 often prefers using the native implementation, which is much slower which defeats the purpose of having an intrinsic in the first place.
The problem seem to arise from having refersTo0() being virtual, native and @IntrinsicCandidate. There are other similar functions (Object.clone(), Object.hashCode()). These get special treatment by C2 to get the intrinsic generated more optimally.
A workaround for Reference.refersTo is described inJDK-8271862. Using that would remove the need for special compiler treatment to get the intrinsic used more. But it's seems a little kludgy, so even if done first it may still be worth adding the special compiler treatment and backing out the workaround (if already applied).
The problem seem to arise from having refersTo0() being virtual, native and @IntrinsicCandidate. There are other similar functions (Object.clone(), Object.hashCode()). These get special treatment by C2 to get the intrinsic generated more optimally.
A workaround for Reference.refersTo is described in
- relates to
-
JDK-8271862 C2 intrinsic for Reference.refersTo() is often not used
- Resolved