Intrinsics for MethodHandlesImpl

Halimi, Jean-Philippe jean-philippe.halimi at intel.com
Thu Nov 8 04:38:12 UTC 2018


Dear all,

I am currently looking into implementing an intrinsic in Graal, namely MethodHandleImpl::profileBoolean which is intrinsified in C2 (Work is tracked in https://bugs.openjdk.java.net/browse/JDK-8212670)
In C2, the matching is done as follows:

  do_class(java_lang_invoke_MethodHandleImpl,               "java/lang/invoke/MethodHandleImpl")                        \
  do_intrinsic(_profileBoolean, java_lang_invoke_MethodHandleImpl, profileBoolean_name, profileBoolean_signature, F_S)  \
   do_name(     profileBoolean_name,                             "profileBoolean")                                      \
   do_signature(profileBoolean_signature,                        "(Z[I)Z")

In Graal's Graph Plugin Builder, I was thinking of adding a match as follows:

    private static void registerMethodHandlesPlugins(InvocationPlugins plugins, BytecodeProvider bytecodeProvider) {
        Registration r = new Registration(plugins, Arrays.class, bytecodeProvider);
        r.registerMethodSubstitution(MethodHandleImpl.class, "profileBoolean", boolean.class, int[].class);
    }

My problem is that I cannot find a proper way to import MethodHandleImpl, since it does not seem directly importable. Is this direction the right one, and if so which import should I use?

Thanks,
Jp
 


More information about the graal-dev mailing list