Package org.jruby.ir.instructions
Class ArrayDerefInstr
- All Implemented Interfaces:
ClosureAcceptingInstr,ResultInstr,Site
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
FieldsFields inherited from class org.jruby.ir.instructions.CallBase
argsCount, callSite, callSiteCounter, callSiteId, hasClosure, nameFields inherited from class org.jruby.ir.instructions.NOperandInstr
operandsFields inherited from class org.jruby.ir.instructions.Instr
EMPTY_OPERANDS -
Constructor Summary
ConstructorsConstructorDescriptionArrayDerefInstr(IRScope scope, Variable result, Operand obj, FrozenString arg0, int flags) ArrayDerefInstr(IRScope scope, Variable result, Operand obj, FrozenString arg0, int flags, CallSite callSite, long callSiteId) -
Method Summary
Modifier and TypeMethodDescriptionClone 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).static ArrayDerefInstrcreate(IRScope scope, Variable result, Operand obj, FrozenString arg0, int flags) static ArrayDerefInstrvoidgetKey()interpret(ThreadContext context, StaticScope currScope, DynamicScope dynamicScope, IRubyObject self, Object[] temp) voidMethods inherited from class org.jruby.ir.instructions.CallInstr
create, getResult, updateResultMethods inherited from class org.jruby.ir.instructions.CallBase
blockInlining, canBeEval, cloneCallArgs, computeScopeFlags, containsArgSplat, getArg1, getArgsCount, getCallArgs, getCallSite, getCallSiteFor, getCallSiteId, getCallType, getClosureArg, getClosureArg, getFlags, getId, getName, getReceiver, hasLiteralClosure, inliningBlocked, isAllFixnums, isAllFloats, isPotentiallyRefined, prepareArguments, prepareArgumentsComplex, prepareArgumentsSimple, prepareBlock, setCallSiteId, simplifyOperands, splatMap, targetRequiresCallersBinding, targetRequiresCallersFrame, toStringNonOperandArgsMethods inherited from class org.jruby.ir.instructions.NOperandInstr
getOperands, setOperandMethods inherited from class org.jruby.ir.instructions.Instr
canBeDeletedFromScope, canRaiseException, cloneOperands, dumpableFields, getOperation, getUsedVariables, hasSideEffects, interpretAndGetNewIPC, isDead, isDeletable, markDead, renameVars, simplifyInstr, simplifyOperands, toString, transfersControl
-
Field Details
-
AREF
-
ASET
-
-
Constructor Details
-
ArrayDerefInstr
public ArrayDerefInstr(IRScope scope, Variable result, Operand obj, FrozenString arg0, int flags, CallSite callSite, long callSiteId) -
ArrayDerefInstr
-
-
Method Details
-
create
public static ArrayDerefInstr create(IRScope scope, Variable result, Operand obj, FrozenString arg0, int flags) -
clone
Description copied from class:InstrClone 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.- Overrides:
clonein classOneOperandArgNoBlockCallInstr- Parameters:
ii- This object manages renaming of variables and labels, handles args and return values.- Returns:
- a new instruction that can be used in the target scope.
-
encode
-
decode
-
interpret
public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope dynamicScope, IRubyObject self, Object[] temp) - Overrides:
interpretin classOneOperandArgNoBlockCallInstr
-
visit
-
getKey
-