-
Enhancement
-
Resolution: Fixed
-
P3
-
None
-
repo-panama
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.
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.
- blocks
-
JDK-8255902 Enable stack arguments for native invokers & optimized upcall stubs
-
- Resolved
-