RFC: Refactoring SystemABI

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Fri Nov 23 13:59:39 UTC 2018


On 23/11/2018 13:51, Maurizio Cimadamore wrote:
> plus I'm not sure how we can effectively invoke a MH from native code.

Some excerpts from JDK javadocs on MethodHandle::invokeXYZ methods

      * When this method is observed via the Core Reflection API,
      * it will appear as a single native method, taking an object array 
and returning an object.
      * If this native method is invoked directly via
      * {@link java.lang.reflect.Method#invoke 
java.lang.reflect.Method.invoke}, via JNI,
      * or indirectly via {@link 
java.lang.invoke.MethodHandles.Lookup#unreflect Lookup.unreflect},
      * it will throw an {@code UnsupportedOperationException}.

So, with regular API this cannot be done, although I suspect Hotspot 
gurus might have some internal way to do this (?)

Maurizio



More information about the panama-dev mailing list