Top Description Fields Constructors Methods
org.jruby.ir.instructions

public Class ReceivePostReqdArgInstr

extends ReceiveIndexedArgBase
implements FixedArityInstr
Class Inheritance
All Implemented Interfaces
org.jruby.ir.instructions.FixedArityInstr
Imports
org.jruby.ir.IRVisitor, .Operation, org.jruby.ir.operands.Operand, .Variable, org.jruby.ir.persistence.IRReaderDecoder, .IRWriterEncoder, org.jruby.ir.runtime.IRRuntimeHelpers, org.jruby.ir.transformations.inlining.CloneInfo, .InlineCloneInfo, .SimpleCloneInfo, org.jruby.parser.StaticScope, org.jruby.runtime.DynamicScope, .ThreadContext, org.jruby.runtime.builtin.IRubyObject

This represents a required arg that shows up after optional/rest args in a method/block parameter list. This instruction gets to pick an argument based on how many arguments have already been accounted for by parameters present earlier in the list.

Field Summary

Modifier and TypeField and Description
public final int
optArgsCount

The method/block parameter list has a maximum of this many optional arguments

public final int
postReqdArgsCount

The method/block parameter list has these many required parameters after opt+rest args

public final int
preReqdArgsCount

The method/block parameter list has these many required parameters before opt+rest args

public final boolean
restArg

Does this method/block accept a rest argument

Inherited from org.jruby.ir.instructions.ReceiveIndexedArgBase:
argIndex

Constructor Summary

AccessConstructor and Description
public
ReceivePostReqdArgInstr(Variable result, Variable keywords, int argIndex, int preReqdArgsCount, int optArgCount, boolean restArg, int postReqdArgsCount)

Method Summary

Modifier and TypeMethod and Description
public Instr
clone(CloneInfo
This object manages renaming of variables and labels, handles args and return values.
info
)

Implements abstract org.jruby.ir.instructions.Instr.clone.

Clone the instruction for use in an inlining context (either when a scope is inlined into another scope, or when a block has to be cloned because its associated call belongs to an inlined scope).

public static ReceivePostReqdArgInstr
public void
public IRubyObject
receivePostReqdArg(ThreadContext context, IRubyObject self, DynamicScope currDynScope, StaticScope currScope, Object[] temp, IRubyObject[] args)

public String[]
public void
Inherited from org.jruby.ir.instructions.ReceiveIndexedArgBase:
getArgIndex

Field Detail

optArgsCountback to summary
public final int optArgsCount

The method/block parameter list has a maximum of this many optional arguments

postReqdArgsCountback to summary
public final int postReqdArgsCount

The method/block parameter list has these many required parameters after opt+rest args

preReqdArgsCountback to summary
public final int preReqdArgsCount

The method/block parameter list has these many required parameters before opt+rest args

restArgback to summary
public final boolean restArg

Does this method/block accept a rest argument

Constructor Detail

ReceivePostReqdArgInstrback to summary
public ReceivePostReqdArgInstr(Variable result, Variable keywords, int argIndex, int preReqdArgsCount, int optArgCount, boolean restArg, int postReqdArgsCount)

Method Detail

cloneback to summary
public Instr clone(CloneInfo info)

Implements abstract org.jruby.ir.instructions.Instr.clone.

Doc from org.jruby.ir.instructions.Instr.clone.

Clone the instruction for use in an inlining context (either when a scope is inlined into another scope, or when a block has to be cloned because its associated call belongs to an inlined scope). This might renaming variables and labels to eliminate naming conflicts. The implementation might vary on the cloning mode.

Parameters
info:CloneInfo

This object manages renaming of variables and labels, handles args and return values.

Returns:Instr

a new instruction that can be used in the target scope.

Annotations
@Override
decodeback to summary
public static ReceivePostReqdArgInstr decode(IRReaderDecoder d)
encodeback to summary
public void encode(IRWriterEncoder e)

Overrides org.jruby.ir.instructions.ReceiveIndexedArgBase.encode.

Annotations
@Override
receivePostReqdArgback to summary
public IRubyObject receivePostReqdArg(ThreadContext context, IRubyObject self, DynamicScope currDynScope, StaticScope currScope, Object[] temp, IRubyObject[] args)
toStringNonOperandArgsback to summary
public String[] toStringNonOperandArgs()

Overrides org.jruby.ir.instructions.Instr.toStringNonOperandArgs.

Annotations
@Override
visitback to summary
public void visit(IRVisitor visitor)

Overrides org.jruby.ir.instructions.Instr.visit.

Annotations
@Override