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

Add a withInvokeExactBehavior() VarHandle combinator

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • 16
    • 16
    • core-libs
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: