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

public Class ReceiveKeywordsInstr

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

Gets the keyword arg (or representation of what might be holding keyword args). The result of this is passed into the other keyword arg instructions to get what those instrs are interested in. One intent of this result is that it can be mutable so it can toggle off keyword arg flags early in the method before any exceptions or side-effects in the method can occur. It also can remove key/value pairs as individual keyword instructions execute. After all individual instructions have executed anything left is either kwrest or an arity error.

Field Summary

Modifier and TypeField and Description
pack-priv final boolean
pack-priv final boolean

Constructor Summary

AccessConstructor and Description
public
ReceiveKeywordsInstr(Variable result, boolean hasRestArg, boolean acceptsKeywords)

Method Summary

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

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 ReceiveKeywordsInstr
public void
public boolean
public IRubyObject
receiveArg(ThreadContext context, IRubyObject self, DynamicScope currDynScope, StaticScope currScope, Object[] temp, IRubyObject[] args, boolean ruby2keywords)

Implements org.jruby.ir.instructions.ArgReceiver.receiveArg.

public void
Inherited from org.jruby.ir.instructions.NoOperandResultBaseInstr:
getOperandssetOperand

Field Detail

acceptsKeywordsback to summary
pack-priv final boolean acceptsKeywords
hasRestArgback to summary
pack-priv final boolean hasRestArg

Constructor Detail

ReceiveKeywordsInstrback to summary
public ReceiveKeywordsInstr(Variable result, boolean hasRestArg, boolean acceptsKeywords)

Method Detail

acceptsKeywordsback to summary
public boolean acceptsKeywords()
cloneback to summary
public Instr clone(CloneInfo ii)

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
ii: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 ReceiveKeywordsInstr decode(IRReaderDecoder d)
encodeback to summary
public void encode(IRWriterEncoder e)

Overrides org.jruby.ir.instructions.ResultBaseInstr.encode.

Annotations
@Override
hasRestArgback to summary
public boolean hasRestArg()
receiveArgback to summary
public IRubyObject receiveArg(ThreadContext context, IRubyObject self, DynamicScope currDynScope, StaticScope currScope, Object[] temp, IRubyObject[] args, boolean ruby2keywords)

Implements org.jruby.ir.instructions.ArgReceiver.receiveArg.

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

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

Annotations
@Override