public abstract class Operator extends Object
Instruction
.
For each operator in the IR, we create exactly one Operator instance
to represent it. These instances are all stored in static fields
of Operators
. Since only one instance is created for each
semantic operator, they can be compared using ==
.Operators
,
Instruction
Modifier and Type | Field and Description |
---|---|
protected static int |
acquire
operator is an acquire (monitorenter/lock) HIR only
|
protected static int |
alloc
an explicit memory allocation
|
protected static int |
branch
operator is an intraprocedural branch of some form
|
protected static int |
call
operator is some kind of call (interprocedural branch)
|
protected static int |
commutative
operator is commutative
|
protected static int |
compare
operator is some kind of compare (val,val)-> cond
|
protected static int |
conditional
modifer for branches/calls
|
protected static int |
dynLink
operator either directly or indirectly may casue dynamic linking
|
protected static int |
ethrow
is an exception throw
|
byte |
format
Encoding of the operator's InstructionFormat.
|
protected static int |
fpPop
operator pops floating-point stack after performing defs
|
protected static int |
fpPush
operator pushs floating-point stack before performing defs
|
protected static int |
immedPEI
an immediate PEI (null_check, int_zero_check, but _not_ call);
|
int |
implicitDefs
Physical registers that are implicitly defined by the operator.
|
int |
implicitUses
Physical registers that are implicitly used by the operator.
|
protected static int |
indirect
modifier for branches/calls, mostly on MIR
|
protected static int |
load
an explicit load of a value from memory
|
protected static int |
memAsLoad
operator is modeled as a load by memory system, mostly on MIR
|
protected static int |
memAsStore
operator is modeled as a store by memory system, mostly on MIR
|
protected static int |
move
operator is a simple move operation from one "register" to another
|
static int |
none
operator has no interesting traits
|
private int |
numberDefs
How many operands of the operator are (pure) defs?
|
private int |
numberDefUses
How many operands of the operator are both defs and uses?
|
private int |
numberUses
How many operands of the operator are pure uses?
|
(package private) char |
opcode
The operators opcode.
|
protected static int |
release
operator is a relase (monitorexit/unlock) HIR only
|
protected static int |
ret
a return instruction (interprocedural branch)
|
protected static int |
store
an explicit store of a value to memory
|
private int |
traits
encoding of operator traits (characteristics)
|
protected static int |
tsp
operator is a potential thread switch point for some reason
other than being a call/immedPEI
|
static int |
varDefs
operator has a variable number of defs
|
static int |
varUses
operator has a variable number of uses
|
protected static int |
yieldPoint
operator is a yield point
|
Modifier | Constructor and Description |
---|---|
protected |
Operator(char opcode,
byte format,
int traits,
int numDefs,
int numDefUses,
int numUses,
int iDefs,
int iUses) |
Modifier and Type | Method and Description |
---|---|
int |
getNumberOfDefs()
Returns the number of operands that are defs
(either pure defs or combined def/uses).
|
int |
getNumberOfDefUses()
Returns the number of operands that are defs
and uses.
|
int |
getNumberOfFixedPureDefs()
Returns the number of operands that are pure defs
and are not in the variable-length part of the operand list.
|
int |
getNumberOfFixedPureUses()
Returns the number of operands that are pure uses
and are not in the variable-length part of the operand list.
|
int |
getNumberOfFixedUses()
Returns the number of operands that are uses
(either combined use/defs or pure uses)
and are not in the variable-length part of the operand list.
|
int |
getNumberOfImplicitDefs()
Returns the number of physical registers that are
implicitly defined by this operator.
|
int |
getNumberOfImplicitUses()
Returns the number of physical registers that are
implicitly used by this operator.
|
int |
getNumberOfPureDefs()
Returns the number of operands that are defs.
|
int |
getNumberOfPureFixedUses()
Returns the number of operands that are pure uses
and are not in the variable-length part of the operand list.
|
int |
getNumberOfPureUses()
Returns the number of operands that are pure uses.
|
int |
getNumberOfUses()
Returns the number of operands that are uses
(either combined def/uses or pure uses).
|
char |
getOpcode() |
boolean |
hasVarDefs()
Can the operator have a variable number of uses?
|
boolean |
hasVarUses()
Can the operator have a variable number of uses?
|
boolean |
hasVarUsesOrDefs()
Can the operator have a variable number of uses or defs?
|
abstract int |
instTemplate() |
boolean |
isAcquire()
Is the operator an acquire (monitorenter/lock)?
|
boolean |
isAdviseESP() |
boolean |
isAllocation()
Is the operator an actual memory allocation instruction
(NEW, NEWARRAY, etc)?
|
boolean |
isBranch()
Is the operator an intraprocedural branch?
|
boolean |
isCall()
Is the operator a call (one kind of interprocedural branch)?
|
boolean |
isCallSaveVolatile() |
boolean |
isCommutative()
Is the operator commutative?
|
boolean |
isCompare()
Is the operator a compare (val,val) => condition?
|
boolean |
isConditionalBranch()
Is the operator a conditional intraprocedural branch?
|
boolean |
isConditionalCall()
Is the operator a conditional call?
|
boolean |
isDirectBranch()
Is the operator a direct intraprocedural branch?
|
boolean |
isDirectCall()
Is the operator a direct call?
|
boolean |
isDynamicLinkingPoint()
Could the operator either directly or indirectly
cause dynamic class loading?
|
boolean |
isExplicitLoad()
Is the operator an explicit load of a finite set of values from
a finite set of memory locations (load, load multiple, _not_ call)?
|
boolean |
isExplicitStore()
Is the operator an explicit store of a finite set of values to
a finite set of memory locations (store, store multiple, _not_ call)?
|
boolean |
isFClear() |
boolean |
isFNInit() |
boolean |
isFpPop()
Does the operator pop the floating-point stack?
|
boolean |
isFpPush()
Does the operator push on the floating-point stack?
|
boolean |
isGCPoint()
Is the operator a potential GC point?
|
boolean |
isImplicitLoad()
Should the operator be treated as a load from some unknown location(s)
for the purposes of scheduling and/or modeling the memory subsystem?
|
boolean |
isImplicitStore()
Should the operator be treated as a store to some unknown location(s)
for the purposes of scheduling and/or modeling the memory subsystem?
|
boolean |
isIndirectBranch()
Is the operator an indirect intraprocedural branch?
|
boolean |
isIndirectCall()
Is the operator an indirect call?
|
boolean |
isMove()
Does the operator represent a simple move (the value is unchanged)
from one "register" location to another "register" location?
|
boolean |
isPEI()
Is the operator a PEI (Potentially Excepting Instruction)?
|
boolean |
isRelease()
Is the operator a release (monitorexit/unlock)?
|
boolean |
isReturn()
Is the operator a return (interprocedural branch)?
|
boolean |
isThrow()
Is the operator a throw of a Java exception?
|
boolean |
isTSPoint()
is the operator a potential thread switch point?
|
boolean |
isUnconditionalBranch()
Is the operator an unconditional intraprocedural branch?
|
boolean |
isUnconditionalCall()
Is the operator an unconditional call?
|
boolean |
isYieldPoint()
Is the operator a yield point?
|
static Operator |
lookupOpcode(int opcode) |
String |
toString()
Returns the string representation of this operator.
|
public static final int none
protected static final int move
protected static final int branch
protected static final int call
protected static final int conditional
protected static final int indirect
protected static final int load
protected static final int memAsLoad
protected static final int store
protected static final int memAsStore
protected static final int ethrow
protected static final int immedPEI
protected static final int compare
protected static final int alloc
protected static final int ret
public static final int varUses
public static final int varDefs
protected static final int tsp
protected static final int acquire
protected static final int release
protected static final int dynLink
protected static final int yieldPoint
protected static final int fpPop
protected static final int fpPush
protected static final int commutative
final char opcode
public final byte format
Instruction
contains an explanation
of the role of InstructionFormats in the IR.private final int traits
private final int numberDefs
private final int numberDefUses
private final int numberUses
public final int implicitDefs
public final int implicitUses
protected Operator(char opcode, byte format, int traits, int numDefs, int numDefUses, int numUses, int iDefs, int iUses)
public static Operator lookupOpcode(int opcode)
public final char getOpcode()
public int getNumberOfPureDefs()
public int getNumberOfFixedPureDefs()
public int getNumberOfFixedPureUses()
public int getNumberOfDefUses()
public int getNumberOfPureUses()
public int getNumberOfDefs()
public int getNumberOfUses()
public int getNumberOfPureFixedUses()
public int getNumberOfFixedUses()
public int getNumberOfImplicitDefs()
public int getNumberOfImplicitUses()
public boolean isMove()
true
if the operator is a simple move
or false
if it is not.public boolean isBranch()
true
if the operator is am
intraprocedural branch or false
if it is not.public boolean isConditionalBranch()
true
if the operator is a conditoonal
intraprocedural branch or false
if it is not.public boolean isUnconditionalBranch()
true
if the operator is an unconditional
intraprocedural branch or false
if it is not.public boolean isDirectBranch()
true
if the operator is a direct
intraprocedural branch or false
if it is not.public boolean isIndirectBranch()
true
if the operator is an indirect
interprocedural branch or false
if it is not.public boolean isCall()
true
if the operator is a call
or false
if it is not.public boolean isConditionalCall()
true
if the operator is a
conditional call or false
if it is not.public boolean isUnconditionalCall()
true
if the operator is an unconditional
call or false
if it is not.public boolean isDirectCall()
true
if the operator is a direct call
or false
if it is not.public boolean isIndirectCall()
true
if the operator is an indirect call
or false
if it is not.public boolean isExplicitLoad()
true
if the operator is an explicit load
or false
if it is not.public boolean isImplicitLoad()
true
if the operator is an implicit load
or false
if it is not.public boolean isExplicitStore()
true
if the operator is an explicit store
or false
if it is not.public boolean isImplicitStore()
true
if the operator is an implicit store
or false
if it is not.public boolean isThrow()
true
if the operator is a throw
or false
if it is not.public boolean isPEI()
true
if the operator is a PEI
or false
if it is not.public boolean isGCPoint()
true
if the operator is a potential
GC point or false
if it is not.public boolean isTSPoint()
true
if the operator is a potential
threadswitch point or false
if it is not.public boolean isCompare()
true
if the operator is a compare
or false
if it is not.public boolean isAllocation()
true
if the operator is an allocation
or false
if it is not.public boolean isReturn()
true
if the operator is a return
or false
if it is not.public boolean hasVarUses()
true
if the operator has a variable number
of uses or false
if it does not.public boolean hasVarDefs()
true
if the operator has a variable number
of uses or false
if it does not.public boolean hasVarUsesOrDefs()
true
if the operator has a variable number
of uses or defs or false
if it does not.public boolean isAcquire()
true
if the operator is an acquire
or false
if it is not.public boolean isRelease()
true
if the operator is a release
or false
if it is not.public boolean isDynamicLinkingPoint()
true
if the operator is a dynamic linking point
or false
if it is not.public boolean isYieldPoint()
true
if the operator is a yield point
or false
if it is not.public boolean isFpPop()
true
if the operator pops the floating-point
stack.
or false
if not.public boolean isFpPush()
true
if the operator pushes on the floating-point
stack.
or false
if not.public boolean isCommutative()
true
if the operator is commutative.
or false
if not.public boolean isCallSaveVolatile()
public boolean isAdviseESP()
public boolean isFNInit()
public boolean isFClear()
public abstract int instTemplate()