gpt4 book ai didi

org.jruby.ir.instructions.ZSuperInstr类的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 04:59:31 26 4
gpt4 key购买 nike

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

ZSuperInstr介绍

暂无

代码示例

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

@Override
public Instr clone(CloneInfo ii) {
  return new ZSuperInstr(ii.getScope(), ii.getRenamedVariable(getResult()), getReceiver().cloneForInlining(ii),
      cloneCallArgs(ii), getClosureArg() == null ? null : getClosureArg().cloneForInlining(ii),
      isPotentiallyRefined(), getCallSite(), getCallSiteId());
}

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

@Override
public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) {
  IRubyObject[] args = prepareArguments(context, self, currScope, currDynScope, temp);
  Block block = prepareBlock(context, self, currScope, currDynScope, temp);
  return IRRuntimeHelpers.zSuper(context, self, args, block);
}

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

protected IRubyObject[] prepareArguments(ThreadContext context, IRubyObject self, Operand[] arguments, DynamicScope dynamicScope, Object[] temp) {
  // Unlike calls, zsuper args are known only at interpret time, not at constructor time.
  // So, we cannot use the cached containsSplat field from CallBase
  return containsSplat(arguments) ?
      prepareArgumentsComplex(context, self, arguments, dynamicScope, temp) :
      prepareArgumentsSimple(context, self, arguments, dynamicScope, temp);
}

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

@Override
public void ZSuperInstr(ZSuperInstr zsuperinstr) {
  String name = zsuperinstr.getId();
  Operand[] args = zsuperinstr.getCallArgs();
  // this would be getDefiningModule but that is not used for unresolved super
  Operand definingModule = UndefinedValue.UNDEFINED;
  boolean[] splatMap = zsuperinstr.splatMap();
  Operand closure = zsuperinstr.getClosureArg(null);
  superCommon(name, zsuperinstr, args, definingModule, splatMap, closure);
}

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

@Override
public Object interpret(ThreadContext context, DynamicScope currDynScope, IRubyObject self, Object[] temp, Block aBlock) {
  DynamicScope argsDynScope = currDynScope;
  // Find args that need to be passed into super
  while (!argsDynScope.getStaticScope().isArgumentScope()) argsDynScope = argsDynScope.getNextCapturedScope();
  IRScope argsIRScope = ((IRStaticScope)argsDynScope.getStaticScope()).getIRScope();
  Operand[] superArgs = (argsIRScope instanceof IRMethod) ? ((IRMethod)argsIRScope).getCallArgs() : ((IRClosure)argsIRScope).getBlockArgs();
  // Prepare args -- but look up in 'argsDynScope', not 'currDynScope'
  IRubyObject[] args = prepareArguments(context, self, superArgs, argsDynScope, temp);
  // Prepare block -- fetching from the frame stack, if necessary
  Block block = prepareBlock(context, self, currDynScope, temp);
  if (block == null || !block.isGiven()) block = context.getFrameBlock();
  return interpretSuper(context, self, args, block);
}

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

@Override
public Instr cloneForInlining(InlinerInfo ii) {
  return new ZSuperInstr(ii.getRenamedVariable(result), getReceiver().cloneForInlining(ii), closure == null ? null : closure.cloneForInlining(ii));
}

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

public static ZSuperInstr decode(IRReaderDecoder d) {
  if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding call");
  int callTypeOrdinal = d.decodeInt();
  CallType callType = CallType.fromOrdinal(callTypeOrdinal);
  if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding call, calltype(ord):  " + callType);
  RubySymbol methAddr = d.decodeSymbol();
  if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding call, methaddr:  " + methAddr);
  Operand receiver = d.decodeOperand();
  int argsCount = d.decodeInt();
  boolean hasClosureArg = argsCount < 0;
  int argsLength = hasClosureArg ? (-1 * (argsCount + 1)) : argsCount;
  if (RubyInstanceConfig.IR_READING_DEBUG)
    System.out.println("ARGS: " + argsLength + ", CLOSURE: " + hasClosureArg);
  Operand[] args = new Operand[argsLength];
  for (int i = 0; i < argsLength; i++) {
    args[i] = d.decodeOperand();
  }
  Operand closure = hasClosureArg ? d.decodeOperand() : null;
  if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("before result");
  Variable result = d.decodeVariable();
  if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding call, result:  " + result);
  return new ZSuperInstr(d.getCurrentScope(), result, receiver, args, closure, d.getCurrentScope().maybeUsingRefinements());
}

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

case UNRESOLVED_SUPER: return UnresolvedSuperInstr.decode(this);
case YIELD: return YieldInstr.decode(this);
case ZSUPER: return ZSuperInstr.decode(this);

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

@Override
public Object interpret(ThreadContext context, DynamicScope currDynScope, IRubyObject self, Object[] temp, Block aBlock) {
  DynamicScope argsDynScope = currDynScope;
  // Find args that need to be passed into super
  while (!argsDynScope.getStaticScope().isArgumentScope()) argsDynScope = argsDynScope.getNextCapturedScope();
  IRScope argsIRScope = ((IRStaticScope)argsDynScope.getStaticScope()).getIRScope();
  Operand[] superArgs = (argsIRScope instanceof IRMethod) ? ((IRMethod)argsIRScope).getCallArgs() : ((IRClosure)argsIRScope).getBlockArgs();
  // Prepare args -- but look up in 'argsDynScope', not 'currDynScope'
  IRubyObject[] args = prepareArguments(context, self, superArgs, argsDynScope, temp);
  // Prepare block -- fetching from the frame stack, if necessary
  Block block = prepareBlock(context, self, currDynScope, temp);
  if (block == null || !block.isGiven()) block = context.getFrameBlock();
  return interpretSuper(context, self, args, block);
}

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

@Override
public void ZSuperInstr(ZSuperInstr zsuperinstr) {
  String name = zsuperinstr.getId();
  Operand[] args = zsuperinstr.getCallArgs();
  // this would be getDefiningModule but that is not used for unresolved super
  Operand definingModule = UndefinedValue.UNDEFINED;
  boolean[] splatMap = zsuperinstr.splatMap();
  Operand closure = zsuperinstr.getClosureArg(null);
  superCommon(name, zsuperinstr, args, definingModule, splatMap, closure);
}

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

@Override
public Instr cloneForInlining(InlinerInfo ii) {
  return new ZSuperInstr(ii.getRenamedVariable(result), getReceiver().cloneForInlining(ii), closure == null ? null : closure.cloneForInlining(ii));
}

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

public static ZSuperInstr decode(IRReaderDecoder d) {
  if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding call");
  int callTypeOrdinal = d.decodeInt();
  CallType callType = CallType.fromOrdinal(callTypeOrdinal);
  if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding call, calltype(ord):  " + callType);
  RubySymbol methAddr = d.decodeSymbol();
  if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding call, methaddr:  " + methAddr);
  Operand receiver = d.decodeOperand();
  int argsCount = d.decodeInt();
  boolean hasClosureArg = argsCount < 0;
  int argsLength = hasClosureArg ? (-1 * (argsCount + 1)) : argsCount;
  if (RubyInstanceConfig.IR_READING_DEBUG)
    System.out.println("ARGS: " + argsLength + ", CLOSURE: " + hasClosureArg);
  Operand[] args = new Operand[argsLength];
  for (int i = 0; i < argsLength; i++) {
    args[i] = d.decodeOperand();
  }
  Operand closure = hasClosureArg ? d.decodeOperand() : null;
  if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("before result");
  Variable result = d.decodeVariable();
  if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding call, result:  " + result);
  return new ZSuperInstr(d.getCurrentScope(), result, receiver, args, closure, d.getCurrentScope().maybeUsingRefinements());
}

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

case UNRESOLVED_SUPER: return UnresolvedSuperInstr.decode(this);
case YIELD: return YieldInstr.decode(this);
case ZSUPER: return ZSuperInstr.decode(this);

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

@Override
public Instr clone(CloneInfo ii) {
  return new ZSuperInstr(ii.getScope(), ii.getRenamedVariable(getResult()), getReceiver().cloneForInlining(ii),
      cloneCallArgs(ii), getClosureArg() == null ? null : getClosureArg().cloneForInlining(ii),
      isPotentiallyRefined(), getCallSite(), getCallSiteId());
}

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

@Override
public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) {
  IRubyObject[] args = prepareArguments(context, self, currScope, currDynScope, temp);
  Block block = prepareBlock(context, self, currScope, currDynScope, temp);
  return IRRuntimeHelpers.zSuper(context, self, args, block);
}

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

protected IRubyObject[] prepareArguments(ThreadContext context, IRubyObject self, Operand[] arguments, DynamicScope dynamicScope, Object[] temp) {
  // Unlike calls, zsuper args are known only at interpret time, not at constructor time.
  // So, we cannot use the cached containsSplat field from CallBase
  return containsSplat(arguments) ?
      prepareArgumentsComplex(context, self, arguments, dynamicScope, temp) :
      prepareArgumentsSimple(context, self, arguments, dynamicScope, temp);
}

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

receiveBreakException(s, block, new ZSuperInstr(ret, getSelf(s), block));
return ret;

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

receiveBreakException(s, block, new ZSuperInstr(ret, getSelf(s), block));
return ret;

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com