public final NativeInvoker forceCompilation() { NativeInvoker invoker = null; while (!getJITHandle().compilationFailed() && (invoker = getJITHandle().compile(getImplementationClass(), function, signature, getName())) == null) ; return invoker; } }
@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args) { return getNativeInvoker().call(context, self, clazz, name, args); }
protected final NativeInvoker getNativeInvoker() { return compiledInvoker != null ? compiledInvoker : tryCompilation(); }
public static MethodHandle getFastNumericMethodHandle(JRubyCallSite site, DynamicMethod method) { Signature signature = (method instanceof NativeInvoker) ? ((NativeInvoker) method).getSignature() : ((DefaultMethod) method).getSignature(); : ((DefaultMethod) method).getCallContext(); : ((DefaultMethod) method).getFunctionAddress();
DynamicMethod createMethod(RubyModule module, Function function, Type returnType, Type[] parameterTypes, CallingConvention convention, IRubyObject enums, boolean ignoreError) { FunctionInvoker functionInvoker = getFunctionInvoker(returnType); ParameterMarshaller[] marshallers = new ParameterMarshaller[parameterTypes.length]; for (int i = 0; i < parameterTypes.length; ++i) { marshallers[i] = getMarshaller(parameterTypes[i], convention, enums); if (marshallers[i] == null) { throw module.getRuntime().newTypeError("Could not create marshaller for " + parameterTypes[i]); } } Signature signature = new Signature(returnType, parameterTypes, convention, ignoreError, enums instanceof RubyHash ? (RubyHash) enums : null); BufferNativeInvoker fallbackInvoker = new BufferNativeInvoker(module, function, signature, functionInvoker, marshallers); return parameterTypes.length <= 6 ? new DefaultMethod(module, function, signature, fallbackInvoker) : fallbackInvoker; }
private static MethodHandle getDirectPointerParameterGuard(JRubyCallSite site, DynamicMethod method) { Signature signature = (method instanceof NativeInvoker) ? ((NativeInvoker) method).getSignature() : ((DefaultMethod) method).getSignature(); MethodHandle[] guards = new MethodHandle[signature.getParameterCount()]; Arrays.fill(guards, 0, guards.length, Binder.from(boolean.class, IRubyObject.class).drop(0, 1).constant(true));
private static MethodHandle generateNativeInvokerHandle(JRubyCallSite site, DynamicMethod method) throws IndyNotSupportedException { if (method instanceof org.jruby.ext.ffi.jffi.DefaultMethod) { NativeInvoker nativeInvoker = ((org.jruby.ext.ffi.jffi.DefaultMethod) method).forceCompilation(); if (nativeInvoker == null) {
public static MethodHandle getFastNumericMethodHandle(JRubyCallSite site, DynamicMethod method) { Signature signature = (method instanceof NativeInvoker) ? ((NativeInvoker) method).getSignature() : ((DefaultMethod) method).getSignature(); : ((DefaultMethod) method).getCallContext(); : ((DefaultMethod) method).getFunctionAddress();
DynamicMethod createMethod(RubyModule module, Function function, Type returnType, Type[] parameterTypes, CallingConvention convention, IRubyObject enums, boolean ignoreError) { FunctionInvoker functionInvoker = getFunctionInvoker(returnType); ParameterMarshaller[] marshallers = new ParameterMarshaller[parameterTypes.length]; for (int i = 0; i < parameterTypes.length; ++i) { marshallers[i] = getMarshaller(parameterTypes[i], convention, enums); if (marshallers[i] == null) { throw module.getRuntime().newTypeError("Could not create marshaller for " + parameterTypes[i]); } } Signature signature = new Signature(returnType, parameterTypes, convention, ignoreError, enums instanceof RubyHash ? (RubyHash) enums : null); BufferNativeInvoker fallbackInvoker = new BufferNativeInvoker(module, function, signature, functionInvoker, marshallers); return parameterTypes.length <= 6 ? new DefaultMethod(module, function, signature, fallbackInvoker) : fallbackInvoker; }
private static MethodHandle getDirectPointerParameterGuard(JRubyCallSite site, DynamicMethod method) { Signature signature = (method instanceof NativeInvoker) ? ((NativeInvoker) method).getSignature() : ((DefaultMethod) method).getSignature(); MethodHandle[] guards = new MethodHandle[signature.getParameterCount()]; Arrays.fill(guards, 0, guards.length, Binder.from(boolean.class, IRubyObject.class).drop(0, 1).constant(true));
private static MethodHandle generateNativeInvokerHandle(JRubyCallSite site, DynamicMethod method) throws IndyNotSupportedException { if (method instanceof org.jruby.ext.ffi.jffi.DefaultMethod) { NativeInvoker nativeInvoker = ((org.jruby.ext.ffi.jffi.DefaultMethod) method).forceCompilation(); if (nativeInvoker == null) {
public final NativeInvoker forceCompilation() { NativeInvoker invoker = null; while (!getJITHandle().compilationFailed() && (invoker = getJITHandle().compile(getImplementationClass(), function, signature, getName())) == null) ; return invoker; } }
@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args, Block block) { return getNativeInvoker().call(context, self, clazz, name, args, block); }
protected final NativeInvoker getNativeInvoker() { return compiledInvoker != null ? compiledInvoker : tryCompilation(); }
DynamicMethod createMethod(RubyModule module, Function function, Type returnType, Type[] parameterTypes, CallingConvention convention, IRubyObject enums, boolean ignoreError) { FunctionInvoker functionInvoker = getFunctionInvoker(returnType); ParameterMarshaller[] marshallers = new ParameterMarshaller[parameterTypes.length]; for (int i = 0; i < parameterTypes.length; ++i) { marshallers[i] = getMarshaller(parameterTypes[i], convention, enums); if (marshallers[i] == null) { throw module.getRuntime().newTypeError("Could not create marshaller for " + parameterTypes[i]); } } Signature signature = new Signature(returnType, parameterTypes, convention, ignoreError, enums instanceof RubyHash ? (RubyHash) enums : null); BufferNativeInvoker fallbackInvoker = new BufferNativeInvoker(module, function, signature, functionInvoker, marshallers); return parameterTypes.length <= 6 ? new DefaultMethod(module, function, signature, fallbackInvoker) : fallbackInvoker; }
public final NativeInvoker forceCompilation() { NativeInvoker invoker = null; while (!getJITHandle().compilationFailed() && (invoker = getJITHandle().compile(getImplementationClass(), function, signature, getName())) == null) ; return invoker; } }
@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args) { return getNativeInvoker().call(context, self, clazz, name, args); }
protected final NativeInvoker getNativeInvoker() { return compiledInvoker != null ? compiledInvoker : tryCompilation(); }
DynamicMethod createMethod(RubyModule module, Function function, Type returnType, Type[] parameterTypes, CallingConvention convention, IRubyObject enums, boolean ignoreError) { FunctionInvoker functionInvoker = getFunctionInvoker(returnType); ParameterMarshaller[] marshallers = new ParameterMarshaller[parameterTypes.length]; for (int i = 0; i < parameterTypes.length; ++i) { marshallers[i] = getMarshaller(parameterTypes[i], convention, enums); if (marshallers[i] == null) { throw module.getRuntime().newTypeError("Could not create marshaller for " + parameterTypes[i]); } } Signature signature = new Signature(returnType, parameterTypes, convention, ignoreError, enums instanceof RubyHash ? (RubyHash) enums : null); BufferNativeInvoker fallbackInvoker = new BufferNativeInvoker(module, function, signature, functionInvoker, marshallers); return parameterTypes.length <= 6 ? new DefaultMethod(module, function, signature, fallbackInvoker) : fallbackInvoker; }
public final NativeInvoker forceCompilation() { NativeInvoker invoker = null; while (!getJITHandle().compilationFailed() && (invoker = getJITHandle().compile(getImplementationClass(), function, signature, getName())) == null) ; return invoker; } }