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

public Class ArrayDerefInstr

extends OneOperandArgNoBlockCallInstr
Class Inheritance
Imports
org.jruby.RubyInstanceConfig, .RubyString, org.jruby.ir.IRScope, .IRVisitor, .Operation, org.jruby.ir.instructions.specialized.OneOperandArgNoBlockCallInstr, org.jruby.ir.operands.FrozenString, .Operand, .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.CallSite, .CallType, .DynamicScope, .ThreadContext, org.jruby.runtime.builtin.IRubyObject, org.jruby.util.ByteList

Instruction representing Ruby code of the form: "a['str']" which is equivalent to: a.[]('str'). Because a Hash receiver would immediately freeze the string, we can freeze and dedup the string ahead of time and call [] directly.

Field Summary

Modifier and TypeField and Description
public static final ByteList
public static final ByteList
private final FrozenString

Constructor Summary

AccessConstructor and Description
public
ArrayDerefInstr(IRScope scope, Variable result, Operand obj, FrozenString arg0, int flags, CallSite callSite, long callSiteId)

public
ArrayDerefInstr(IRScope scope, Variable result, Operand obj, FrozenString arg0, int flags)

Method Summary

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

Overrides org.jruby.ir.instructions.specialized.OneOperandArgNoBlockCallInstr.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 ArrayDerefInstr
create(IRScope scope, Variable result, Operand obj, FrozenString arg0, int flags)

public static ArrayDerefInstr
public void
public FrozenString
public Object
public void

Field Detail

AREFback to summary
public static final ByteList AREF
ASETback to summary
public static final ByteList ASET
keyback to summary
private final FrozenString key

Constructor Detail

ArrayDerefInstrback to summary
public ArrayDerefInstr(IRScope scope, Variable result, Operand obj, FrozenString arg0, int flags, CallSite callSite, long callSiteId)
ArrayDerefInstrback to summary
public ArrayDerefInstr(IRScope scope, Variable result, Operand obj, FrozenString arg0, int flags)

Method Detail

cloneback to summary
public Instr clone(CloneInfo ii)

Overrides org.jruby.ir.instructions.specialized.OneOperandArgNoBlockCallInstr.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
createback to summary
public static ArrayDerefInstr create(IRScope scope, Variable result, Operand obj, FrozenString arg0, int flags)
decodeback to summary
public static ArrayDerefInstr decode(IRReaderDecoder d)

Hides org.jruby.ir.instructions.CallInstr.decode.

encodeback to summary
public void encode(IRWriterEncoder e)

Overrides org.jruby.ir.instructions.CallInstr.encode.

Annotations
@Override
getKeyback to summary
public FrozenString getKey()
interpretback to summary
public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope dynamicScope, IRubyObject self, Object[] temp)

Overrides org.jruby.ir.instructions.specialized.OneOperandArgNoBlockCallInstr.interpret.

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

Overrides org.jruby.ir.instructions.CallInstr.visit.

Annotations
@Override