@Override public Instr clone(CloneInfo ii) { return new CallInstr(ii.getScope(), getOperation(), getCallType(), ii.getRenamedVariable(result), getName(), getReceiver().cloneForInlining(ii), cloneCallArgs(ii), getClosureArg() == null ? null : getClosureArg().cloneForInlining(ii), isPotentiallyRefined(), getCallSite(), getCallSiteId()); }
public static CallInstr create(IRScope scope, Variable result, RubySymbol name, Operand receiver, Operand[] args, Operand closure) { return create(scope, CallType.NORMAL, result, name, receiver, args, closure); }
public CallInstr(Operation op, CallInstr ordinary) { this(op, ordinary.getCallType(), ordinary.getResult(), ordinary.getMethodAddr(), ordinary.getReceiver(), ordinary.getCallArgs(), ordinary.getClosureArg(null)); }
@Override public CallBase specializeForInterpretation() { Operand[] callArgs = getCallArgs(); if (hasClosure() || containsSplat(callArgs)) return this; switch (callArgs.length) { case 0: return new ZeroOperandArgNoBlockCallInstr(this); case 1: if (isAllFixnums()) return new OneFixnumArgNoBlockCallInstr(this); return new OneOperandArgNoBlockCallInstr(this); } return this; }
@Override public Instr cloneForInlining(InlinerInfo ii) { return new CallInstr(getCallType(), ii.getRenamedVariable(result), (MethAddr) getMethodAddr().cloneForInlining(ii), receiver.cloneForInlining(ii), cloneCallArgs(ii), closure == null ? null : closure.cloneForInlining(ii)); }
public static CallInstr create(IRScope scope, CallType callType, Variable result, RubySymbol name, Operand receiver, Operand[] args, Operand closure) { boolean isPotentiallyRefined = scope.maybeUsingRefinements(); if (!containsArgSplat(args)) { boolean hasClosure = closure != null; if (args.length == 0 && !hasClosure) { return new ZeroOperandArgNoBlockCallInstr(scope, callType, result, name, receiver, args, isPotentiallyRefined); } else if (args.length == 1) { if (hasClosure) return new OneOperandArgBlockCallInstr(scope, callType, result, name, receiver, args, closure, isPotentiallyRefined); if (isAllFixnums(args)) return new OneFixnumArgNoBlockCallInstr(scope, callType, result, name, receiver, args, isPotentiallyRefined); if (isAllFloats(args)) return new OneFloatArgNoBlockCallInstr(scope, callType, result, name, receiver, args, isPotentiallyRefined); return new OneOperandArgNoBlockCallInstr(scope, callType, result, name, receiver, args, isPotentiallyRefined); } else if (args.length == 2 && !hasClosure) { return new TwoOperandArgNoBlockCallInstr(scope, callType, result, name, receiver, args, isPotentiallyRefined); } } return new CallInstr(scope, callType, result, name, receiver, args, closure, isPotentiallyRefined); }
List<KeyValuePair<Operand, Operand>> kwargs = buildKeywordArguments(keywordArgs); block = setupCallClosure(fcallNode.getIterNode()); callInstr = CallInstr.createWithKwargs(scope, CallType.FUNCTIONAL, result, fcallNode.getName(), buildSelf(), args, block, kwargs); } else { Operand[] args = setupCallArgs(callArgsNode); callInstr = CallInstr.create(scope, CallType.FUNCTIONAL, result, fcallNode.getName(), buildSelf(), args, block);
public static CallInstr create(Variable result, MethAddr methAddr, Operand receiver, Operand[] args, Operand closure) { return new CallInstr(CallType.NORMAL, result, methAddr, receiver, args, closure); }
receiveBreakException(block, new CodeBlock() { public Operand run() { addInstr(callInstr); return callInstr.getResult(); } }); }
private void superCommon(String name, CallInstr instr, Operand[] args, Operand definingModule, boolean[] splatMap, Operand closure) { IRBytecodeAdapter m = jvmMethod(); Operation operation = instr.getOperation(); jvmStoreLocal(instr.getResult());
@Override public boolean computeScopeFlags(IRScope scope) { super.computeScopeFlags(scope); // $~ is implicitly used since Backref and NthRef operands // access it and $~ is not made explicit in those operands. scope.getFlags().add(REQUIRES_BACKREF); return true; }
@Override public Instr cloneForInlining(InlinerInfo ii) { return new CallInstr(getCallType(), ii.getRenamedVariable(result), (MethAddr) getMethodAddr().cloneForInlining(ii), receiver.cloneForInlining(ii), cloneCallArgs(ii), closure == null ? null : closure.cloneForInlining(ii)); }
public static CallInstr create(IRScope scope, CallType callType, Variable result, RubySymbol name, Operand receiver, Operand[] args, Operand closure) { boolean isPotentiallyRefined = scope.maybeUsingRefinements(); if (!containsArgSplat(args)) { boolean hasClosure = closure != null; if (args.length == 0 && !hasClosure) { return new ZeroOperandArgNoBlockCallInstr(scope, callType, result, name, receiver, args, isPotentiallyRefined); } else if (args.length == 1) { if (hasClosure) return new OneOperandArgBlockCallInstr(scope, callType, result, name, receiver, args, closure, isPotentiallyRefined); if (isAllFixnums(args)) return new OneFixnumArgNoBlockCallInstr(scope, callType, result, name, receiver, args, isPotentiallyRefined); if (isAllFloats(args)) return new OneFloatArgNoBlockCallInstr(scope, callType, result, name, receiver, args, isPotentiallyRefined); return new OneOperandArgNoBlockCallInstr(scope, callType, result, name, receiver, args, isPotentiallyRefined); } else if (args.length == 2 && !hasClosure) { return new TwoOperandArgNoBlockCallInstr(scope, callType, result, name, receiver, args, isPotentiallyRefined); } } return new CallInstr(scope, callType, result, name, receiver, args, closure, isPotentiallyRefined); }
@Override public CallBase specializeForInterpretation() { Operand[] callArgs = getCallArgs(); if (hasClosure() || containsSplat(callArgs)) return this; switch (callArgs.length) { case 0: return new ZeroOperandArgNoBlockCallInstr(this); case 1: if (isAllFixnums()) return new OneFixnumArgNoBlockCallInstr(this); return new OneOperandArgNoBlockCallInstr(this); } return this; }
List<KeyValuePair<Operand, Operand>> kwargs = buildKeywordArguments(keywordArgs); block = setupCallClosure(fcallNode.getIterNode()); callInstr = CallInstr.createWithKwargs(scope, CallType.FUNCTIONAL, result, fcallNode.getName(), buildSelf(), args, block, kwargs); } else { Operand[] args = setupCallArgs(callArgsNode); callInstr = CallInstr.create(scope, CallType.FUNCTIONAL, result, fcallNode.getName(), buildSelf(), args, block);
public static CallInstr create(Variable result, MethAddr methAddr, Operand receiver, Operand[] args, Operand closure) { return new CallInstr(CallType.NORMAL, result, methAddr, receiver, args, closure); }
receiveBreakException(block, new CodeBlock() { public Operand run() { addInstr(callInstr); return callInstr.getResult(); } }); }
private void superCommon(String name, CallInstr instr, Operand[] args, Operand definingModule, boolean[] splatMap, Operand closure) { IRBytecodeAdapter m = jvmMethod(); Operation operation = instr.getOperation(); jvmStoreLocal(instr.getResult());
@Override public boolean computeScopeFlags(IRScope scope) { super.computeScopeFlags(scope); // $~ is implicitly used since Backref and NthRef operands // access it and $~ is not made explicit in those operands. scope.getFlags().add(REQUIRES_BACKREF); return true; }
public CallInstr(Operation op, CallInstr ordinary) { this(op, ordinary.getCallType(), ordinary.getResult(), ordinary.getMethodAddr(), ordinary.getReceiver(), ordinary.getCallArgs(), ordinary.getClosureArg(null)); }