public abstract class Instr extends Object
Modifier and Type | Field and Description |
---|---|
static Operand[] |
EMPTY_OPERANDS |
Modifier and Type | Method and Description |
---|---|
boolean |
canBeDeleted(IRScope s) |
boolean |
canRaiseException() |
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 |
cloneForInlinedClosure(InlinerInfo ii)
Clone the instruction (present in a closure) so it can be inlined into another scope.
|
Instr |
cloneForInlinedScope(InlinerInfo ii)
Clone the instruction (present in a method/closure) so it can be inlined into another scope.
|
Instr |
cloneForInlining(InlinerInfo inlinerInfo)
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).
|
abstract Operand[] |
getOperands() |
Operation |
getOperation() |
List<Variable> |
getUsedVariables() |
boolean |
hasSideEffects() |
boolean |
hasUnusedResult() |
Object |
interpret(ThreadContext context,
DynamicScope currDynScope,
IRubyObject self,
Object[] temp,
Block block) |
int |
interpretAndGetNewIPC(ThreadContext context,
DynamicScope currDynScope,
IRubyObject self,
Object[] temp,
int ipc) |
boolean |
isDead() |
void |
markDead() |
void |
markUnusedResult() |
void |
renameVars(Map<Operand,Operand> renameMap) |
Operand |
simplifyAndGetResult(IRScope scope,
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(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.
|
String |
toString() |
boolean |
transfersControl() |
void |
visit(IRVisitor visitor) |
public static final Operand[] EMPTY_OPERANDS
public Instr(Operation operation)
public Operation getOperation()
public boolean hasSideEffects()
public boolean canRaiseException()
public boolean transfersControl()
public boolean canBeDeleted(IRScope s)
public void markDead()
public boolean isDead()
public void markUnusedResult()
public boolean hasUnusedResult()
public abstract Operand[] getOperands()
public Instr cloneForInlining(InlinerInfo inlinerInfo)
inlinerInfo
- This object manages renaming of variables and labels, handles
args and return values.public Instr cloneForInlinedScope(InlinerInfo ii)
inlinerInfo
- This object manages renaming of variables and labels, handles
args and return values.public Instr cloneForInlinedClosure(InlinerInfo ii)
inlinerInfo
- This object manages renaming of variables and labels, handles
args and return values.public Instr cloneForBlockCloning(InlinerInfo ii)
inlinerInfo
- This object manages renaming of variables and labels, handling
scope args and return values.public void simplifyOperands(Map<Operand,Operand> valueMap, boolean force)
public Operand simplifyAndGetResult(IRScope scope, Map<Operand,Operand> valueMap)
valueMap
- Mapping from operands to their simplified valuespublic Object interpret(ThreadContext context, DynamicScope currDynScope, IRubyObject self, Object[] temp, Block block)
public int interpretAndGetNewIPC(ThreadContext context, DynamicScope currDynScope, IRubyObject self, Object[] temp, int ipc)
public void visit(IRVisitor visitor)
Copyright © 2001-2014 JRuby. All Rights Reserved.