use of com.oracle.truffle.espresso.nodes.IntrinsifiedNativeMethodNode in project graal by oracle.
the class JniEnv method lookupKnownVmMethods.
private Substitutions.EspressoRootNodeFactory lookupKnownVmMethods(@Pointer TruffleObject closure, Method targetMethod) {
try {
long jvmMethodAddress = InteropLibrary.getUncached().asPointer(closure);
CallableFromNative.Factory knownVmMethod = getVM().lookupKnownVmMethod(jvmMethodAddress);
if (knownVmMethod != null) {
if (!IntrinsifiedNativeMethodNode.validParameterCount(knownVmMethod, targetMethod)) {
getLogger().warning("Implicit intrinsification of VM method does not have matching parameter counts:");
getLogger().warning("VM method " + knownVmMethod.methodName() + " has " + knownVmMethod.parameterCount() + " parameters,");
getLogger().warning("Bound to " + (targetMethod.isStatic() ? "static" : "instance") + " method " + targetMethod.getNameAsString() + " which has " + targetMethod.getParameterCount() + " parameters");
return null;
}
return createJniRootNodeFactory(() -> new IntrinsifiedNativeMethodNode(knownVmMethod, targetMethod, getVM()), targetMethod);
}
} catch (UnsupportedMessageException e) {
// ignore
}
return null;
}
Aggregations