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

Eagerly generate native invokers

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: repo-panama
    • Fix Version/s: None
    • Component/s: tools

      Description

      Currently, when intrinsifying downcalls C2 generates so called 'native invokers': stubs that do a thread state transition and then jump into the target function.

      These have a few disadvantages:
      - They do not accept the target address dynamically, meaning virtual calls are not intrinsified.
      - They do not shuffle any arguments, this is left to C2, meaning that stack arguments can not be supported.
      - Pre-intrinsification, downcalls rely on a fallback method handle, which is yet another invocation mode to support, and dispatching to the fallback handle currently has a somewhat hacky implementation.

      By moving the native invoker generation to be more eager we forego the need for the fallback strategy, and, because this requires handling virtual target addresses and argument shuffling as well, simultaneously takes care of the former 2 issues as well.

      As additional positive side effects: an eager generation strategy seems more amenable to AOT environments, and our testing coverage of the native invoker code goes up by a lot as well, since we are now always using it, not only in intrinsified cases.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: