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

Add a withInvokeExactBehavior() VarHandle combinator

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 16
    • 16
    • core-libs
    • None

      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.

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

              Created:
              Updated:
              Resolved: