/** * For blocks which cannot be executed in parallel. * @param methodName * @param arity */ public JavaInternalBlockBody(Ruby runtime, ThreadContext originalContext, String methodName, Arity arity) { super(BlockBody.SINGLE_RESTARG); this.arity = arity; this.originalContext = originalContext; this.methodName = methodName; this.dummyScope = runtime.getStaticScopeFactory().getDummyScope(); }
private CallBlock(Arity arity, BlockCallback callback, ThreadContext context) { super(BlockBody.SINGLE_RESTARG); this.arity = arity; this.callback = callback; this.dummyScope = context.runtime.getStaticScopeFactory().getDummyScope(); }
private CallBlock(Arity arity, BlockCallback callback, ThreadContext context) { super(BlockBody.SINGLE_RESTARG); this.arity = arity; this.callback = callback; this.dummyScope = context.runtime.getStaticScopeFactory().getDummyScope(); }
private CallBlock(Signature signature, BlockCallback callback, ThreadContext context) { super(signature); this.callback = callback; this.dummyScope = context.runtime.getStaticScopeFactory().getDummyScope(); }
public CallBlock19(Signature signature, BlockCallback callback, ThreadContext context) { super(signature); this.callback = callback; this.dummy = context.runtime.getStaticScopeFactory().getDummyScope(); }
private CallBlock(Signature signature, BlockCallback callback, ThreadContext context) { super(signature); this.callback = callback; this.dummyScope = context.runtime.getStaticScopeFactory().getDummyScope(); }
/** * For blocks which cannot be executed in parallel. */ public JavaInternalBlockBody(Ruby runtime, ThreadContext originalContext, String methodName, Signature signature) { super(signature); this.originalContext = originalContext; this.methodName = methodName; this.dummyScope = runtime.getStaticScopeFactory().getDummyScope(); }
public CallBlock19(Signature signature, BlockCallback callback, ThreadContext context) { super(signature); this.callback = callback; this.dummy = context.runtime.getStaticScopeFactory().getDummyScope(); }
/** * For blocks which cannot be executed in parallel. */ public JavaInternalBlockBody(Ruby runtime, ThreadContext originalContext, String methodName, Signature signature) { super(signature); this.originalContext = originalContext; this.methodName = methodName; this.dummyScope = runtime.getStaticScopeFactory().getDummyScope(); }
private CallBlock19(Arity arity, BlockCallback callback, ThreadContext context) { super(BlockBody.SINGLE_RESTARG); this.arity = arity; this.callback = callback; this.dummy = context.runtime.getStaticScopeFactory().getDummyScope(); }
private CallBlock19(Arity arity, BlockCallback callback, ThreadContext context) { super(BlockBody.SINGLE_RESTARG); this.arity = arity; this.callback = callback; this.dummy = context.runtime.getStaticScopeFactory().getDummyScope(); }
/** * For blocks which cannot be executed in parallel. * @param methodName * @param arity */ public JavaInternalBlockBody(Ruby runtime, ThreadContext originalContext, String methodName, Arity arity) { super(BlockBody.SINGLE_RESTARG); this.arity = arity; this.originalContext = originalContext; this.methodName = methodName; this.dummyScope = runtime.getStaticScopeFactory().getDummyScope(); }
public SymbolProcBody(Ruby runtime, String symbol) { super(runtime.getStaticScopeFactory().getDummyScope(), Signature.OPTIONAL); this.site = MethodIndex.getFunctionalCallSite(symbol); }
public SymbolProcBody(Ruby runtime, String symbol) { super(runtime.getStaticScopeFactory().getDummyScope(), Signature.OPTIONAL); this.site = MethodIndex.getFunctionalCallSite(symbol); }
/** Create a Proc object. * */ @JRubyMethod public IRubyObject to_proc(ThreadContext context, Block unusedBlock) { Ruby runtime = context.runtime; CompiledBlockCallback19 callback = new CompiledBlockCallback19() { @Override public IRubyObject call(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) { return method.call(context, receiver, originModule, originName, args, block); } @Override public String getFile() { return getFilename(); } @Override public int getLine() { return RubyMethod.this.getLine(); } }; BlockBody body = CompiledBlockLight19.newCompiledBlockLight(method.getArity(), runtime.getStaticScopeFactory().getDummyScope(), callback, false, 0, JRubyLibrary.MethodExtensions.methodParameters(runtime, method)); Block b = new Block(body, context.currentBinding(receiver, Visibility.PUBLIC)); return RubyProc.newProc(runtime, b, Block.Type.LAMBDA); }
/** Create a Proc object. * */ @JRubyMethod public IRubyObject to_proc(ThreadContext context, Block unusedBlock) { Ruby runtime = context.runtime; CompiledBlockCallback19 callback = new CompiledBlockCallback19() { @Override public IRubyObject call(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) { return method.call(context, receiver, originModule, originName, args, block); } @Override public String getFile() { return getFilename(); } @Override public int getLine() { return RubyMethod.this.getLine(); } }; BlockBody body = CompiledBlockLight19.newCompiledBlockLight(method.getArity(), runtime.getStaticScopeFactory().getDummyScope(), callback, false, 0, JRubyLibrary.MethodExtensions.methodParameters(runtime, method)); Block b = new Block(body, context.currentBinding(receiver, Visibility.PUBLIC)); return RubyProc.newProc(runtime, b, Block.Type.LAMBDA); }
@JRubyMethod public IRubyObject to_proc(ThreadContext context) { StaticScope scope = context.runtime.getStaticScopeFactory().getDummyScope(); final CallSite site = new FunctionalCachingCallSite(symbol); BlockBody body = new ContextAwareBlockBody(scope, Arity.OPTIONAL, BlockBody.SINGLE_RESTARG) {
@JRubyMethod public IRubyObject to_proc(ThreadContext context) { StaticScope scope = context.runtime.getStaticScopeFactory().getDummyScope(); final CallSite site = new FunctionalCachingCallSite(symbol); BlockBody body = new ContextAwareBlockBody(scope, Arity.OPTIONAL, BlockBody.SINGLE_RESTARG) {
/** Create a Proc object. * */ @JRubyMethod public IRubyObject to_proc(ThreadContext context) { Ruby runtime = context.runtime; MethodBlockBody body; Signature signature; ArgumentDescriptor[] argsDesc; if (method instanceof IRMethodArgs) { signature = ((IRMethodArgs) method).getSignature(); argsDesc = ((IRMethodArgs) method).getArgumentDescriptors(); } else { signature = Signature.from(method.getArity()); argsDesc = Helpers.methodToArgumentDescriptors(method); } int line = getLine(); // getLine adds 1 to 1-index but we need to reset to 0-index internally body = new MethodBlockBody(runtime.getStaticScopeFactory().getDummyScope(), signature, method, argsDesc, receiver, originModule, originName, getFilename(), line == -1 ? -1 : line - 1); Block b = MethodBlockBody.createMethodBlock(body); return RubyProc.newProc(runtime, b, Block.Type.LAMBDA); }
/** Create a Proc object. * */ @JRubyMethod public IRubyObject to_proc(ThreadContext context) { Ruby runtime = context.runtime; MethodBlockBody body; Signature signature; ArgumentDescriptor[] argsDesc; if (method instanceof IRMethodArgs) { signature = ((IRMethodArgs) method).getSignature(); argsDesc = ((IRMethodArgs) method).getArgumentDescriptors(); } else { signature = Signature.from(method.getArity()); argsDesc = Helpers.methodToArgumentDescriptors(method); } int line = getLine(); // getLine adds 1 to 1-index but we need to reset to 0-index internally body = new MethodBlockBody(runtime.getStaticScopeFactory().getDummyScope(), signature, method, argsDesc, receiver, originModule, originName, getFilename(), line == -1 ? -1 : line - 1); Block b = MethodBlockBody.createMethodBlock(body); return RubyProc.newProc(runtime, b, Block.Type.LAMBDA); }