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

Add a withInvokeExactBehavior() VarHandle combinator

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 16
    • Component/s: core-libs
    • Labels:
      None

      Description

      Currently, VarHandle invocations are always generic, which means that if the type of the VarHandle accessor does not match the invocation type exactly, we get an asType adaptation, which sometimes prevents the VarHandle from being optimized away.

      To catch these cases more easily, we can add an asExact() method to VarHandle, which will return a new VarHandle that checks the invocation type against the VarHandel's type, and throws an exception if the types do not match, instead of trying to do a type adaptation.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jvernee Jorn Vernee
              Reporter:
              jvernee Jorn Vernee
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: