@Override public CallConfiguration getCallConfig() { return oldMethod.getCallConfig(); } }
@Override public CallConfiguration getCallConfig() { return oldMethod.getCallConfig(); } }
@Override public CallConfiguration getCallConfig() { return delegate.getCallConfig(); }
@Override public CallConfiguration getCallConfig() { return delegate.getCallConfig(); }
@Override public CallConfiguration getCallConfig() { if (compiledMethod == null) initializeMethod(); return compiledMethod.getCallConfig(); }
@Override public CallConfiguration getCallConfig() { if (compiledMethod == null) initializeMethod(); return compiledMethod.getCallConfig(); }
public DelegatingDynamicMethod(DynamicMethod delegate) { super(delegate.getImplementationClass(), delegate.getVisibility(), delegate.getCallConfig()); this.delegate = delegate; }
public DelegatingDynamicMethod(DynamicMethod delegate) { super(delegate.getImplementationClass(), delegate.getVisibility(), delegate.getCallConfig()); this.delegate = delegate; }
@Override public boolean canGenerate(JRubyCallSite site, RubyClass cls, DynamicMethod method) { if (method instanceof org.jruby.ext.ffi.jffi.DefaultMethod || method instanceof org.jruby.ext.ffi.jffi.JITNativeInvoker) { // if frame/scope required, can't dispatch direct if (method.getCallConfig() != CallConfiguration.FrameNoneScopeNone) { throw new IndirectBindingException("frame or scope required: " + method.getCallConfig()); } if (!method.getArity().isFixed()) { throw new IndirectBindingException("fixed arity required: " + method.getArity()); } // Arity must match, otherwise let the indirect method process errors if (method.getArity().getValue() != site.arity()) { throw new IndirectBindingException("arity mismatch"); } // Only support 0..6 parameters if (method.getArity().getValue() > 6) { throw new IndirectBindingException("target args > 6"); } if (site.type().parameterType(site.type().parameterCount() - 1) == Block.class) { // Called with a block to substitute for a callback param - cannot bind directly throw new IndirectBindingException("callback block supplied"); } return true; } return false; }
@Override public boolean canGenerate(JRubyCallSite site, RubyClass cls, DynamicMethod method) { if (method instanceof org.jruby.ext.ffi.jffi.DefaultMethod || method instanceof org.jruby.ext.ffi.jffi.JITNativeInvoker) { // if frame/scope required, can't dispatch direct if (method.getCallConfig() != CallConfiguration.FrameNoneScopeNone) { throw new IndirectBindingException("frame or scope required: " + method.getCallConfig()); } if (!method.getArity().isFixed()) { throw new IndirectBindingException("fixed arity required: " + method.getArity()); } // Arity must match, otherwise let the indirect method process errors if (method.getArity().getValue() != site.arity()) { throw new IndirectBindingException("arity mismatch"); } // Only support 0..6 parameters if (method.getArity().getValue() > 6) { throw new IndirectBindingException("target args > 6"); } if (site.type().parameterType(site.type().parameterCount() - 1) == Block.class) { // Called with a block to substitute for a callback param - cannot bind directly throw new IndirectBindingException("callback block supplied"); } return true; } return false; }
throw new IndyNotSupportedException("arity > 6"); if (!CallConfiguration.FrameNoneScopeNone.equals(method.getCallConfig())) { throw new IndyNotSupportedException("cannot bindy functions with scope or frame");
throw new IndyNotSupportedException("arity > 6"); if (!CallConfiguration.FrameNoneScopeNone.equals(method.getCallConfig())) { throw new IndyNotSupportedException("cannot bindy functions with scope or frame");
.invokeStaticQuiet(site.lookup(), nativeCall.getNativeTarget(), nativeCall.getNativeName()); nativeTarget = wrapWithFraming(fullSig, method.getCallConfig(), method.getImplementationClass(), name, nativeTarget, scope);
.invokeStaticQuiet(site.lookup(), nativeCall.getNativeTarget(), nativeCall.getNativeName()); nativeTarget = wrapWithFraming(fullSig, method.getCallConfig(), method.getImplementationClass(), name, nativeTarget, scope);
nativeTarget = permuteArguments(nativeTarget, fullSig.type(), fullSig.to(target)); nativeTarget = wrapWithFraming(fullSig, method.getCallConfig(), method.getImplementationClass(), name, nativeTarget, null);
nativeTarget = permuteArguments(nativeTarget, fullSig.type(), fullSig.to(target)); nativeTarget = wrapWithFraming(fullSig, method.getCallConfig(), method.getImplementationClass(), name, nativeTarget, null);