Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8272140

C2: investigate alternative intrinsic selection for Reference.refersTo

XMLWordPrintable

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

            Unassigned Unassigned
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: