public abstract class Instr
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static Operand[] |
EMPTY_OPERANDS |
Modifier and Type | Method and Description |
---|---|
boolean |
canBeDeletedFromScope(FullInterpreterContext fic) |
boolean |
canRaiseException() |
abstract Instr |
clone(CloneInfo info)
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).
|
Operand[] |
cloneOperands(CloneInfo info) |
boolean |
computeScopeFlags(IRScope scope,
java.util.EnumSet<IRFlags> flags)
Does this instruction do anything the scope is interested in?
|
java.lang.reflect.Field[] |
dumpableFields() |
void |
encode(IRWriterEncoder e) |
abstract Operand[] |
getOperands() |
Operation |
getOperation() |
java.util.List<Variable> |
getUsedVariables() |
boolean |
hasSideEffects() |
java.lang.Object |
interpret(ThreadContext context,
StaticScope currScope,
DynamicScope currDynScope,
IRubyObject self,
java.lang.Object[] temp) |
int |
interpretAndGetNewIPC(ThreadContext context,
DynamicScope currDynScope,
StaticScope currScope,
IRubyObject self,
java.lang.Object[] temp,
int ipc) |
boolean |
isDead() |
boolean |
isDeletable()
Can this instruction be deleted? LVA will preserve instructions based on whether operands (variables)
are living but even if there are no living variables then the instruction itself may not be able to be removed
during DCE for other reasons (like if it unconditionally has a side-effect)
|
void |
markDead() |
void |
renameVars(java.util.Map<Operand,Operand> renameMap) |
abstract void |
setOperand(int i,
Operand operand) |
Operand |
simplifyAndGetResult(IRScope scope,
java.util.Map<Operand,Operand> valueMap)
This method takes as input a map of operands to their values, and outputs
the result of this instruction.
|
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()
Instructions are meant to be in a machine-readable format so offline tooling can parse the
debugging output.
|
java.lang.String[] |
toStringNonOperandArgs() |
boolean |
transfersControl() |
void |
visit(IRVisitor visitor) |
public static final Operand[] EMPTY_OPERANDS
public Instr(Operation operation)
public java.lang.String[] toStringNonOperandArgs()
public void encode(IRWriterEncoder e)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.reflect.Field[] dumpableFields()
public Operation getOperation()
public boolean hasSideEffects()
public boolean canRaiseException()
public boolean transfersControl()
public boolean computeScopeFlags(IRScope scope, java.util.EnumSet<IRFlags> flags)
public boolean isDeletable()
public boolean canBeDeletedFromScope(FullInterpreterContext fic)
public void markDead()
public boolean isDead()
public abstract Operand[] getOperands()
public abstract void setOperand(int i, Operand operand)
public java.util.List<Variable> getUsedVariables()
public abstract Instr clone(CloneInfo info)
info
- This object manages renaming of variables and labels, handles
args and return values.public void simplifyOperands(java.util.Map<Operand,Operand> valueMap, boolean force)
public Operand simplifyAndGetResult(IRScope scope, java.util.Map<Operand,Operand> valueMap)
scope
- where this instr existsvalueMap
- Mapping from operands to their simplified valuespublic java.lang.Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, java.lang.Object[] temp)
public int interpretAndGetNewIPC(ThreadContext context, DynamicScope currDynScope, StaticScope currScope, IRubyObject self, java.lang.Object[] temp, int ipc)
public void visit(IRVisitor visitor)
Copyright © 2001-2022 JRuby. All Rights Reserved.