Package org.jruby.ir.instructions
Class ModuleVersionGuardInstr
java.lang.Object
org.jruby.ir.instructions.Instr
org.jruby.ir.instructions.TwoOperandInstr
org.jruby.ir.instructions.ModuleVersionGuardInstr
- All Implemented Interfaces:
FixedArityInstr
This instruction will be generated whenever speculative optimizations are performed
based on assuming that an object's metaclass is C (as determined by the version number
of C -- where the version number changes every time C's class structure changes).
-
Field Summary
Fields inherited from class org.jruby.ir.instructions.Instr
EMPTY_OPERANDS
-
Constructor Summary
ConstructorsConstructorDescriptionModuleVersionGuardInstr
(RubyModule module, int expectedVersion, Operand candidateObj, Label failurePathLabel) -
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).The object whose metaclass token has to be verifiedint
Where to jump if the version assumption fails?int
interpretAndGetNewIPC
(ThreadContext context, DynamicScope currDynScope, StaticScope currScope, IRubyObject self, Object[] temp, int ipc) String[]
void
Methods inherited from class org.jruby.ir.instructions.TwoOperandInstr
getOperand1, getOperand2, getOperands, setOperand, setOperand1, setOperand2
Methods inherited from class org.jruby.ir.instructions.Instr
canBeDeletedFromScope, canRaiseException, cloneOperands, computeScopeFlags, dumpableFields, encode, getOperation, getUsedVariables, hasSideEffects, interpret, isDead, isDeletable, markDead, renameVars, simplifyInstr, simplifyOperands, simplifyOperands, toString, transfersControl
-
Constructor Details
-
ModuleVersionGuardInstr
public ModuleVersionGuardInstr(RubyModule module, int expectedVersion, Operand candidateObj, Label failurePathLabel)
-
-
Method Details
-
getCandidateObject
The object whose metaclass token has to be verified -
getFailurePathLabel
Where to jump if the version assumption fails? -
getModule
-
getExpectedVersion
public int getExpectedVersion() -
toStringNonOperandArgs
- Overrides:
toStringNonOperandArgs
in classInstr
-
clone
Description copied from class:Instr
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. -
interpretAndGetNewIPC
public int interpretAndGetNewIPC(ThreadContext context, DynamicScope currDynScope, StaticScope currScope, IRubyObject self, Object[] temp, int ipc) - Overrides:
interpretAndGetNewIPC
in classInstr
-
visit
-