org.jruby.runtime.Block.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(159)

本文整理了Java中org.jruby.runtime.Block.<init>()方法的一些代码示例,展示了Block.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Block.<init>()方法的具体详情如下:
包路径:org.jruby.runtime.Block
类名称:Block
方法名:<init>

Block.<init>介绍

暂无

代码示例

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

@Override
  public Block cloneBlock(Binding binding) {
    return new Block(this, binding);
  }
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

@Override
  public Block cloneBlock(Binding binding) {
    return new Block(this, binding);
  }
}

代码示例来源:origin: org.jruby/jruby-complete

public Block cloneBlockAndBinding() {
  Block newBlock = new Block(body, binding.clone());
  newBlock.type = type;
  newBlock.escapeBlock = this;
  return newBlock;
}

代码示例来源:origin: org.jruby/jruby-complete

public static Block newCallClosure(IRubyObject self, RubyModule imClass, Signature signature, BlockCallback callback, ThreadContext context) {
  Binding binding = context.currentBinding(self, Visibility.PUBLIC);
  BlockBody body = new CallBlock(signature, callback, context);
  return new Block(body, binding);
}

代码示例来源:origin: org.jruby/jruby-complete

public static Block newCallClosure(IRubyObject self, RubyModule imClass, Signature signature, BlockCallback callback, ThreadContext context) {
  Binding binding = context.currentBinding(self, Visibility.PUBLIC);
  BlockBody body = new CallBlock19(signature, callback, context);
  return new Block(body, binding);
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

public static Block newCallClosure(IRubyObject self, RubyModule imClass, Arity arity, BlockCallback callback, ThreadContext context) {
  Binding binding = context.currentBinding(self, Visibility.PUBLIC);
  BlockBody body = new CallBlock(arity, callback, context);
  
  return new Block(body, binding);
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

public static Block newCompiledClosureLight(ThreadContext context, IRubyObject self, Arity arity,
    StaticScope scope, CompiledBlockCallback callback, boolean hasMultipleArgsHead, int argumentType) {
  Binding binding = context.currentBinding(self, Visibility.PUBLIC);
  BlockBody body = new CompiledBlockLight(arity, scope, callback, hasMultipleArgsHead, argumentType);
  return new Block(body, binding);
}

代码示例来源:origin: org.jruby/jruby-core

@JIT
public static Block prepareBlock(ThreadContext context, IRubyObject self, DynamicScope scope, BlockBody body) {
  Block block = new Block(body, context.currentBinding(self, scope));
  return block;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

public static Block newCallClosure(IRubyObject self, RubyModule imClass, Arity arity, BlockCallback callback, ThreadContext context) {
  Binding binding = context.currentBinding(self, Visibility.PUBLIC);
  BlockBody body = new CallBlock(arity, callback, context);
  
  return new Block(body, binding);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

public static Block newCompiledSharedScopeClosure(ThreadContext context, IRubyObject self, Arity arity, DynamicScope dynamicScope,
    CompiledBlockCallback callback, boolean hasMultipleArgsHead, int argumentType) {
  Binding binding = context.currentBinding(self, Visibility.PUBLIC, dynamicScope);
  BlockBody body = new CompiledSharedScopeBlock(arity, dynamicScope, callback, hasMultipleArgsHead, argumentType);
  
  return new Block(body, binding);
}

代码示例来源:origin: org.jruby/jruby-complete

@JIT
public static Block prepareBlock(ThreadContext context, IRubyObject self, DynamicScope scope, BlockBody body) {
  Block block = new Block(body, context.currentBinding(self, scope));
  return block;
}

代码示例来源:origin: org.jruby/jruby-core

public static Block newCallClosure(IRubyObject self, RubyModule imClass, Signature signature, BlockCallback callback, ThreadContext context) {
  Binding binding = context.currentBinding(self, Visibility.PUBLIC);
  BlockBody body = new CallBlock19(signature, callback, context);
  return new Block(body, binding);
}

代码示例来源:origin: org.jruby/jruby-complete

@Deprecated
public static Block newCallClosure(IRubyObject self, RubyModule imClass, Arity arity, BlockCallback callback, ThreadContext context) {
  Binding binding = context.currentBinding(self, Visibility.PUBLIC);
  BlockBody body = new CallBlock19(Signature.from(arity), callback, context);
  
  return new Block(body, binding);
}

代码示例来源:origin: org.jruby/jruby-complete

private static IRubyObject doWithEnum(final ThreadContext context, final IRubyObject enume, final EachBody blockImpl) {
  if ( enume.respondsTo("each_entry") ) {
    return enume.callMethod(context, "each_entry", IRubyObject.NULL_ARRAY, new Block(blockImpl));
  }
  if ( enume.respondsTo("each") ) {
    return enume.callMethod(context, "each", IRubyObject.NULL_ARRAY, new Block(blockImpl));
  }
  throw context.runtime.newArgumentError("value must be enumerable");
}

代码示例来源:origin: org.jruby/jruby-complete

@JRubyMethod
public IRubyObject to_proc(ThreadContext context) {
  BlockBody body = new SymbolProcBody(context.runtime, symbol);
  return RubyProc.newProc(context.runtime,
              new Block(body, Binding.DUMMY),
              Block.Type.PROC);
}

代码示例来源:origin: org.jruby/jruby-complete

@Override
public Object retrieve(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope currDynScope, Object[] temp) {
  BlockBody body = closure.getBlockBody();
  closure.getStaticScope().determineModule();
  // In non-inlining scenarios, this.self will always be %self.
  // However, in inlined scenarios, this.self will be the self in the original scope where the closure
  // was present before inlining.
  IRubyObject selfVal = (this.self instanceof Self) ? self : (IRubyObject)this.self.retrieve(context, self, currScope, currDynScope, temp);
  Binding binding = context.currentBinding(selfVal, currDynScope);
  return new Block(body, binding);
}

代码示例来源:origin: org.jruby/jruby-core

@Override
public Object retrieve(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope currDynScope, Object[] temp) {
  BlockBody body = closure.getBlockBody();
  closure.getStaticScope().determineModule();
  // In non-inlining scenarios, this.self will always be %self.
  // However, in inlined scenarios, this.self will be the self in the original scope where the closure
  // was present before inlining.
  IRubyObject selfVal = (this.self instanceof Self) ? self : (IRubyObject)this.self.retrieve(context, self, currScope, currDynScope, temp);
  Binding binding = context.currentBinding(selfVal, currDynScope);
  return new Block(body, binding);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

public static Block newInterpretedClosure(ThreadContext context, IterNode iterNode, IRubyObject self) {
  Binding binding = context.currentBinding(self);
  NodeType argsNodeId = getArgumentTypeWackyHack(iterNode);
  BlockBody body = new InterpretedBlock(
      iterNode,
      Arity.procArityOf(iterNode.getVarNode()),
      asArgumentType(argsNodeId));
  return new Block(body, binding);
}

代码示例来源:origin: org.jruby/jruby-core

@JRubyMethod
public static IRubyObject to_proc(final ThreadContext context, final IRubyObject self) {
  final Ruby runtime = context.runtime;
  final java.lang.Runnable runnable = unwrapIfJavaObject(self);
  final Block block = new Block(new RunBody(runtime, runnable));
  return new RubyProc(runtime, runtime.getProc(), block, null, -1);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

public Block newCompiledClosure(ThreadContext context, IterNode iterNode, IRubyObject self) {
  Binding binding = context.currentBinding(self);
  NodeType argsNodeId = getArgumentTypeWackyHack(iterNode);
  boolean hasMultipleArgsHead = false;
  if (iterNode.getVarNode() instanceof MultipleAsgnNode) {
    hasMultipleArgsHead = ((MultipleAsgnNode) iterNode.getVarNode()).getHeadNode() != null;
  }
  BlockBody body = new CompiledBlock(Arity.procArityOf(iterNode.getVarNode()), iterNode.getScope(), compileBlock(context, new StandardASMCompiler("blahfooblah" + System.currentTimeMillis(), "blahfooblah"), iterNode), hasMultipleArgsHead, BlockBody.asArgumentType(argsNodeId));
  return new Block(body, binding);
}

相关文章