public class ModuleVersionGuardInstr extends Instr
| Modifier and Type | Field and Description |
|---|---|
private Operand |
candidateObj
The object whose metaclass token has to be verified
|
private int |
expectedVersion
The token value that has been assumed
|
private Label |
failurePathLabel
Where to jump if the version assumption fails?
|
private RubyModule |
module
The module whose version we are testing
|
EMPTY_OPERANDS| Constructor and Description |
|---|
ModuleVersionGuardInstr(RubyModule module,
int expectedVersion,
Operand candidateObj,
Label failurePathLabel) |
| Modifier and Type | Method and Description |
|---|---|
Instr |
cloneForBlockCloning(InlinerInfo ii)
Clone the instruction so it can be used in a cloned block which is present in a scope that itself
or an ancestor scope (in the case of nested blocks) is being inlined.
|
Instr |
cloneForInlinedScope(InlinerInfo ii)
Clone the instruction (present in a method/closure) so it can be inlined into another scope.
|
Label |
getFailurePathLabel() |
Operand[] |
getOperands() |
int |
interpretAndGetNewIPC(ThreadContext context,
DynamicScope currDynScope,
IRubyObject self,
java.lang.Object[] temp,
int ipc) |
void |
simplifyOperands(java.util.Map<Operand,Operand> valueMap,
boolean force)
This method takes as input a map of operands to their values, and outputs
If the value map provides a value for any of the instruction's operands
this method is expected to replace the original operands with the simplified values.
|
java.lang.String |
toString() |
private boolean |
versionMatches(ThreadContext context,
DynamicScope currDynScope,
IRubyObject self,
java.lang.Object[] temp) |
void |
visit(IRVisitor visitor) |
canBeDeleted, canRaiseException, cloneForInlinedClosure, cloneForInlining, getOperation, getUsedVariables, hasSideEffects, hasUnusedResult, interpret, isDead, markDead, markUnusedResult, renameVars, simplifyAndGetResult, transfersControlprivate final int expectedVersion
private final RubyModule module
private Operand candidateObj
private Label failurePathLabel
public ModuleVersionGuardInstr(RubyModule module, int expectedVersion, Operand candidateObj, Label failurePathLabel)
public Label getFailurePathLabel()
public Operand[] getOperands()
getOperands in class Instrpublic void simplifyOperands(java.util.Map<Operand,Operand> valueMap, boolean force)
InstrsimplifyOperands in class Instrpublic Instr cloneForInlinedScope(InlinerInfo ii)
InstrcloneForInlinedScope in class Instrpublic Instr cloneForBlockCloning(InlinerInfo ii)
InstrcloneForBlockCloning in class Instrprivate boolean versionMatches(ThreadContext context, DynamicScope currDynScope, IRubyObject self, java.lang.Object[] temp)
public int interpretAndGetNewIPC(ThreadContext context, DynamicScope currDynScope, IRubyObject self, java.lang.Object[] temp, int ipc)
interpretAndGetNewIPC in class Instr