public final NativeInvoker forceCompilation() { NativeInvoker invoker = null; while (!getJITHandle().compilationFailed() && (invoker = getJITHandle().compile(getImplementationClass(), function, signature, getName())) == null) ; return invoker; } }
final NativeInvoker compile(RubyModule implementationClass, com.kenai.jffi.Function function, Signature signature, String methodName) { if (compilationFailed || (counter.incrementAndGet() < THRESHOLD && !"force".equalsIgnoreCase(Options.COMPILE_MODE.load()))) { return null; } Class<? extends NativeInvoker> compiledClass; synchronized (this) { if (compiledClassRef == null || (compiledClass = compiledClassRef.get()) == null) { compiledClass = newInvokerClass(jitSignature, methodName); if (compiledClass == null) { compilationFailed = true; return null; } compiler.registerClass(this, compiledClass); compiledClassRef = new WeakReference<Class<? extends NativeInvoker>>(compiledClass); } } try { Constructor<? extends NativeInvoker> cons = compiledClass.getDeclaredConstructor(RubyModule.class, com.kenai.jffi.Function.class, Signature.class); return cons.newInstance(implementationClass, function, signature); } catch (Throwable t) { throw new RuntimeException(t); } }
return new JITHandle(this, jitSignature, "OFF".equalsIgnoreCase(Options.COMPILE_MODE.load())); JITHandle handle = ref != null ? ref.get() : null; if (handle == null) { handle = new JITHandle(this, jitSignature, "OFF".equalsIgnoreCase(Options.COMPILE_MODE.load())); handles.put(jitSignature, new HandleRef(handle, jitSignature, referenceQueue));
return new JITHandle(this, jitSignature, "OFF".equalsIgnoreCase(Options.COMPILE_MODE.load())); JITHandle handle = ref != null ? ref.get() : null; if (handle == null) { handle = new JITHandle(this, jitSignature, "OFF".equalsIgnoreCase(Options.COMPILE_MODE.load())); handles.put(jitSignature, new HandleRef(handle, jitSignature, referenceQueue));
public final NativeInvoker forceCompilation() { NativeInvoker invoker = null; while (!getJITHandle().compilationFailed() && (invoker = getJITHandle().compile(getImplementationClass(), function, signature, getName())) == null) ; return invoker; } }
final NativeInvoker compile(RubyModule implementationClass, com.kenai.jffi.Function function, Signature signature, String methodName) { if (compilationFailed || (counter.incrementAndGet() < THRESHOLD && Options.COMPILE_MODE.load() != RubyInstanceConfig.CompileMode.FORCE)) { return null; } Class<? extends NativeInvoker> compiledClass; synchronized (this) { if (compiledClassRef == null || (compiledClass = compiledClassRef.get()) == null) { compiledClass = newInvokerClass(jitSignature, methodName); if (compiledClass == null) { compilationFailed = true; return null; } compiler.registerClass(this, compiledClass); compiledClassRef = new WeakReference<Class<? extends NativeInvoker>>(compiledClass); } } try { Constructor<? extends NativeInvoker> cons = compiledClass.getDeclaredConstructor(RubyModule.class, com.kenai.jffi.Function.class, Signature.class); return cons.newInstance(implementationClass, function, signature); } catch (Throwable t) { throw new RuntimeException(t); } }
return new JITHandle(this, jitSignature, Options.COMPILE_MODE.load() == RubyInstanceConfig.CompileMode.OFF); JITHandle handle = ref != null ? ref.get() : null; if (handle == null) { handle = new JITHandle(this, jitSignature, Options.COMPILE_MODE.load() == RubyInstanceConfig.CompileMode.OFF); handles.put(jitSignature, new HandleRef(handle, jitSignature, referenceQueue));
public final NativeInvoker forceCompilation() { NativeInvoker invoker = null; while (!getJITHandle().compilationFailed() && (invoker = getJITHandle().compile(getImplementationClass(), function, signature, getName())) == null) ; return invoker; } }
final NativeInvoker compile(RubyModule implementationClass, com.kenai.jffi.Function function, Signature signature, String methodName) { if (compilationFailed || (counter.incrementAndGet() < THRESHOLD && !"force".equalsIgnoreCase(Options.COMPILE_MODE.load()))) { return null; } Class<? extends NativeInvoker> compiledClass; synchronized (this) { if (compiledClassRef == null || (compiledClass = compiledClassRef.get()) == null) { compiledClass = newInvokerClass(jitSignature, methodName); if (compiledClass == null) { compilationFailed = true; return null; } compiler.registerClass(this, compiledClass); compiledClassRef = new WeakReference<Class<? extends NativeInvoker>>(compiledClass); } } try { Constructor<? extends NativeInvoker> cons = compiledClass.getDeclaredConstructor(RubyModule.class, com.kenai.jffi.Function.class, Signature.class); return cons.newInstance(implementationClass, function, signature); } catch (Throwable t) { throw new RuntimeException(t); } }
return new JITHandle(this, jitSignature, Options.COMPILE_MODE.load() == RubyInstanceConfig.CompileMode.OFF); JITHandle handle = ref != null ? ref.get() : null; if (handle == null) { handle = new JITHandle(this, jitSignature, Options.COMPILE_MODE.load() == RubyInstanceConfig.CompileMode.OFF); handles.put(jitSignature, new HandleRef(handle, jitSignature, referenceQueue));
public final NativeInvoker forceCompilation() { NativeInvoker invoker = null; while (!getJITHandle().compilationFailed() && (invoker = getJITHandle().compile(getImplementationClass(), function, signature, getName())) == null) ; return invoker; } }
final NativeInvoker compile(RubyModule implementationClass, com.kenai.jffi.Function function, Signature signature, String methodName) { if (compilationFailed || (counter.incrementAndGet() < THRESHOLD && Options.COMPILE_MODE.load() != RubyInstanceConfig.CompileMode.FORCE)) { return null; } Class<? extends NativeInvoker> compiledClass; synchronized (this) { if (compiledClassRef == null || (compiledClass = compiledClassRef.get()) == null) { compiledClass = newInvokerClass(jitSignature, methodName); if (compiledClass == null) { compilationFailed = true; return null; } compiler.registerClass(this, compiledClass); compiledClassRef = new WeakReference<Class<? extends NativeInvoker>>(compiledClass); } } try { Constructor<? extends NativeInvoker> cons = compiledClass.getDeclaredConstructor(RubyModule.class, com.kenai.jffi.Function.class, Signature.class); return cons.newInstance(implementationClass, function, signature); } catch (Throwable t) { throw new RuntimeException(t); } }
private synchronized NativeInvoker tryCompilation() { if (compiledInvoker != null) { return compiledInvoker; } NativeInvoker invoker = getJITHandle().compile(getImplementationClass(), function, signature, getName()); if (invoker != null) { compiledInvoker = invoker; getImplementationClass().invalidateCacheDescendants(); return compiledInvoker; } // // Once compilation has failed, always fallback to the default invoker // if (getJITHandle().compilationFailed()) { compiledInvoker = defaultInvoker; getImplementationClass().invalidateCacheDescendants(); } return defaultInvoker; }
private synchronized NativeInvoker tryCompilation() { if (compiledInvoker != null) { return compiledInvoker; } NativeInvoker invoker = getJITHandle().compile(getImplementationClass(), function, signature, getName()); if (invoker != null) { compiledInvoker = invoker; getImplementationClass().invalidateCacheDescendants(); return compiledInvoker; } // // Once compilation has failed, always fallback to the default invoker // if (getJITHandle().compilationFailed()) { compiledInvoker = defaultInvoker; getImplementationClass().invalidateCacheDescendants(); } return defaultInvoker; }
private synchronized NativeInvoker tryCompilation() { if (compiledInvoker != null) { return compiledInvoker; } NativeInvoker invoker = getJITHandle().compile(getImplementationClass(), function, signature, getName()); if (invoker != null) { invoker.setName(getName()); compiledInvoker = invoker; getImplementationClass().invalidateCacheDescendants(); return compiledInvoker; } // // Once compilation has failed, always fallback to the default invoker // if (getJITHandle().compilationFailed()) { compiledInvoker = defaultInvoker; getImplementationClass().invalidateCacheDescendants(); } return defaultInvoker; }
private synchronized NativeInvoker tryCompilation() { if (compiledInvoker != null) { return compiledInvoker; } NativeInvoker invoker = getJITHandle().compile(getImplementationClass(), function, signature, getName()); if (invoker != null) { invoker.setName(getName()); compiledInvoker = invoker; getImplementationClass().invalidateCacheDescendants(); return compiledInvoker; } // // Once compilation has failed, always fallback to the default invoker // if (getJITHandle().compilationFailed()) { compiledInvoker = defaultInvoker; getImplementationClass().invalidateCacheDescendants(); } return defaultInvoker; }