nativeTarget = MethodHandles.lookup().findStatic(
nativeCall.getNativeTarget(),
nativeCall.getNativeName(),
MethodType.methodType(nativeCall.getNativeReturn(),
nativeCall.getNativeSignature()));
CompiledMethod cm = (CompiledMethod)entry.method;
nativeTarget = MethodHandles.insertArguments(nativeTarget, 0, cm.getScriptObject());
nativeTarget = MethodHandles.insertArguments(nativeTarget, nativeTarget.type().parameterCount() - 1, Block.NULL_BLOCK);
int argCount = getRubyArgCount(nativeCall.getNativeSignature());
switch (argCount) {
case 0:
nativeTarget = MethodHandles.permuteArguments(nativeTarget, site.type(), new int[] {0, 2});