public final class MethodOperand extends Operand
TODO: Create subclasses of MethodOperand for internal & specialized targets.
Modifier and Type | Field and Description |
---|---|
private boolean |
designatedOffset |
private static byte |
INTERFACE |
(package private) boolean |
isGuardedInlineOffBranch
Is this the operand of a call that is the off-branch of a guarded inline?
|
(package private) boolean |
isNonReturningCall
Is this the operand of a call that never returns?
|
(package private) boolean |
isPreciseTarget
Is target exactly the method being invoked by this call, or is it
a representative for a family of virtual/interface methods?
|
Offset |
jtocOffset |
(package private) MemberReference |
memRef
Member reference for target.
|
private static byte |
SPECIAL |
SpecializedMethod |
spMethod |
private static byte |
STATIC |
(package private) RVMMethod |
target
Target RVMMethod of invocation.
|
(package private) byte |
type
The type of the invoke (STATIC, SPECIAL, VIRTUAL, INTERFACE)
|
private static byte |
VIRTUAL |
instruction
Modifier | Constructor and Description |
---|---|
private |
MethodOperand(MemberReference ref,
RVMMethod tar,
byte t) |
Modifier and Type | Method and Description |
---|---|
static MethodOperand |
COMPILED(RVMMethod callee,
Offset offset)
Returns a method operand representing a compiled method with designated
JTOC offset.
|
Operand |
copy()
Return a new operand that is semantically equivalent to
this . |
MemberReference |
getMemberRef() |
RVMMethod |
getTarget() |
boolean |
hasDesignatedTarget() |
boolean |
hasPreciseTarget() |
boolean |
hasSpecialVersion() |
boolean |
hasTarget() |
static MethodOperand |
INTERFACE(MethodReference ref,
RVMMethod target)
create a method operand for an INVOKE_INTERFACE bytecode
|
boolean |
isGuardedInlineOffBranch() |
boolean |
isInterface() |
boolean |
isNonReturningCall()
Get whether this operand represents a method call that never
returns (such as a call to athrow());
|
boolean |
isSpecial() |
boolean |
isStatic() |
boolean |
isVirtual() |
void |
refine(RVMMethod target)
Refines the target information.
|
void |
refine(RVMMethod target,
boolean isPreciseTarget)
Refine the target information.
|
void |
refine(RVMType targetClass)
Refines the target information.
|
void |
setIsGuardedInlineOffBranch(boolean f)
Record that this operand is the off branch of a guarded inline
|
void |
setIsNonReturningCall(boolean neverReturns)
Records whether this operand represents a method call that never
returns (such as a call to athrow()).
|
private void |
setPreciseTarget() |
boolean |
similar(Operand op)
Are two operands semantically equivalent?
|
static MethodOperand |
SPECIAL(MethodReference ref,
RVMMethod target)
create a method operand for an INVOKE_SPECIAL bytecode
|
static MethodOperand |
STATIC(MethodReference ref,
RVMMethod target)
create a method operand for an INVOKE_STATIC bytecode
|
static MethodOperand |
STATIC(RVMField target)
create a method operand for an INVOKE_STATIC bytecode
where the target method is known at compile time.
|
static MethodOperand |
STATIC(RVMMethod target)
create a method operand for an INVOKE_STATIC bytecode
where the target method is known at compile time.
|
String |
toString()
Returns the string representation of this operand.
|
static MethodOperand |
VIRTUAL(MethodReference ref,
RVMMethod target)
create a method operand for an INVOKE_VIRTUAL bytecode
|
asAddressConstant, asBlock, asBranch, asClassConstant, asCondition, asDoubleConstant, asFloatConstant, asIntConstant, asLocation, asLongConstant, asMemory, asMethod, asNullConstant, asObjectConstant, asRegister, asStackLocation, asStringConstant, asTIBConstant, asType, conservativelyApproximates, getIndexInInstruction, getType, isAddress, isAddressConstant, isBlock, isBranch, isClassConstant, isConstant, isDefinitelyNull, isDouble, isDoubleConstant, isFloat, isFloatConstant, isInt, isIntConstant, isIntLike, isLocation, isLong, isLongConstant, isMemory, isMethod, isMovableObjectConstant, isNullConstant, isObjectConstant, isRef, isRegister, isStackLocation, isStringConstant, isTIBConstant, isTrueGuard, isType, meet
private static final byte STATIC
private static final byte SPECIAL
private static final byte VIRTUAL
private static final byte INTERFACE
final MemberReference memRef
Usually a MethodReference, but may be a FieldReference for internal methods that don't have 'real' Java method but come from OutOfLineMachineCode.
boolean isPreciseTarget
boolean isNonReturningCall
boolean isGuardedInlineOffBranch
byte type
private boolean designatedOffset
public Offset jtocOffset
public SpecializedMethod spMethod
private MethodOperand(MemberReference ref, RVMMethod tar, byte t)
ref
- MemberReference of method to calltar
- the RVMMethod to call (may be null)t
- the type of invoke used to call it (STATIC, SPECIAL, VIRTUAL, INTERFACE)private void setPreciseTarget()
public static MethodOperand COMPILED(RVMMethod callee, Offset offset)
callee
- the callee methodoffset
- designated jtop offset of compiled method of calleepublic boolean hasDesignatedTarget()
public static MethodOperand SPECIAL(MethodReference ref, RVMMethod target)
ref
- MemberReference of method to calltarget
- the RVMMethod to call (may be null)public static MethodOperand STATIC(MethodReference ref, RVMMethod target)
ref
- MemberReference of method to calltarget
- the RVMMethod to call (may be null)public static MethodOperand STATIC(RVMMethod target)
target
- the RVMMethod to callpublic static MethodOperand STATIC(RVMField target)
target
- the RVMMethod to callpublic static MethodOperand VIRTUAL(MethodReference ref, RVMMethod target)
ref
- MemberReference of method to calltarget
- the RVMMethod to call (may be null)public static MethodOperand INTERFACE(MethodReference ref, RVMMethod target)
ref
- MemberReference of method to calltarget
- the RVMMethod to call (may be null)public boolean isStatic()
public boolean isVirtual()
public boolean isSpecial()
public boolean isInterface()
public boolean hasTarget()
public boolean hasPreciseTarget()
public MemberReference getMemberRef()
public boolean isNonReturningCall()
public void setIsNonReturningCall(boolean neverReturns)
neverReturns
- whether this function will returnpublic boolean isGuardedInlineOffBranch()
public void setIsGuardedInlineOffBranch(boolean f)
f
- if the operand is in the off branch of a guarded inlinepublic void refine(RVMMethod target)
target
- method to use for refining of informationpublic void refine(RVMType targetClass)
targetClass
- class to use for refining of informationpublic void refine(RVMMethod target, boolean isPreciseTarget)
target
- the target methodisPreciseTarget
- whether the target is precisepublic Operand copy()
Operand
this
.public boolean similar(Operand op)
Operand
public boolean hasSpecialVersion()