Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jruby.ir.instructions.ruby19;
 
public class ReceiveOptArgInstr19 extends ReceiveOptArgBase {
    
This instruction gets to pick an argument off the incoming list only if there are at least this many incoming arguments
    public final int minArgsLength;
    public ReceiveOptArgInstr19(Variable resultint indexint minArgsLength) {
        super(resultindex);
        this. = minArgsLength;
    }
    @Override
    public String toString() {
        return (isDead() ? "[DEAD]" : "") + (hasUnusedResult() ? "[DEAD-RESULT]" : "") + getResult() + " = " + getOperation() + "(" +  + ", " +  + ")";
    }
    @Override
    public Instr cloneForInlining(InlinerInfo ii) {
        if (ii.canMapArgsStatically()) {
            int n = ii.getArgsCount();
            return new CopyInstr(ii.getRenamedVariable(),  <= n ? ii.getArg() : .);
        } else {
            return new OptArgMultipleAsgnInstr(ii.getRenamedVariable(), ii.getArgs(), );
        }
    }
    @Override
    public Instr cloneForBlockCloning(InlinerInfo ii) {
    }
    public Object receiveOptArg(IRubyObject[] args) {
        return ( <= args.length ? args[] : .);
    }
    @Override
    public void visit(IRVisitor visitor) {
        visitor.ReceiveOptArgInstr19(this);
    }
New to GrepCode? Check out our FAQ X