Interface IDExpression
- All Superinterfaces:
IDElement,IInstructionOperand
- All Known Subinterfaces:
IDAllocObjectInfo,IDArrayElt,IDCallInfo,IDField,IDImm,IDInstanceField,IDInstruction,IDInvokeInfo,IDNewArrayInfo,IDNewInfo,IDOperation,IDReferenceType,IDStaticField,IDVar
dexdec IR expressions, such as IR instructions, fields/attributes,
immediates, variables/identifiers, operations, etc.-
Field Summary
Fields inherited from interface com.pnfsoftware.jeb.core.units.code.android.ir.IDElement
DEFAULT_COMPARE_WITH_FULL_EQUALITY -
Method Summary
Modifier and TypeMethodDescriptiondefault IDArrayEltCast this IR to an array element.default IDCallInfoCast this IR to call information.default IDImmasImm()Cast this IR to an immediate.default IDInstanceFieldCast this IR to an instance field expression.default IDInstructionCast this IR to an instruction.default IDNewArrayInfoCast this IR to new-array information.default IDNewInfoCast this IR to new-instance information.default IDOperationCast this IR to an operation.default IDReferenceTypeCast this IR to a reference type expression.default IDStaticFieldCast this IR to a static field expression.default IDVarasVar()Cast this IR to a variable.booleancanThrow(IDMethodContext ctx) Determine whether a hypothetical execution of this IR expression could throw.booleanDetermine whether the expression type matches an expected type.voidcollectAllPhysicalMethodIndices(Collection<Integer> physicalMethodIndices) Collect all low-level dex method indices mapped to this IR element and its constituents.voidcollectAllPhysicalOffsets(Collection<Integer> physicalOffsets) Gather all physical offsets for this element and all its constituents.voidCollect all sub-expressions of this expression, in evaluation order.voidcollectVarIds(Set<Integer> sink) Recursively collect all the variable ids used and defined by this expression.copy(DCopyOptions opt) Copy this element.intcountVariable(IDVar var) Count how many times a given identifier is present in an expression.Duplicate this element.evaluate(IDGlobalContext g, Map<Integer, IDImm> varmap) Convenience method: evaluate anon-instructionIR expression using the provided set a variable values.evaluate(IDMethodContext ctx) Convenience method: Evaluate this expression within the context of the provided method.Evaluate this expression.find(IDExpression elt, int start, int comparisonMethod, IDExpression thisParent) Find the parent of the the provided child element.<T extends IDExpression>
TfindByType(Class<T> clazz) Find the first child element by type.<T extends IDExpression>
TfindByType(Class<T> clazz, int start) Find a child element by type.findParent(IDExpression elt) Find the parent of the first instance of the provided child element.findParent(IDExpression elt, int start) Find the parent of the the provided child element.generateAST(IDMethodContext ctx, IJavaMethod m) Generate the Java AST element for this IR expression.Retrieve the custom override set forcanThrow(IDMethodContext).Retrieve a value from this IR element's data map.Retrieve the origin info string of this IR element, if there is one.intRetrieve the low-level dex method index mapping to this IR element.intRetrieve the physical offset (dalvik) associated with this IR.default List<IDExpression> Convenience method used to retrieve all the sub-expressions of this IR, in evaluation order.getType()Get the IR expression type.Recursively collect all the variable ids used and defined by this expression.booleanhasSideEffects(IDMethodContext ctx, boolean includeCanThrow) Determine whether a hypothetical execution of this IR expression would change the program internal state.default booleanDetermine whether this IR is an array element.default booleanDetermine whether this IR is call information.default booleanisCallInfo(String wantedMsig) Determine whether this IR is call information for a method signature.default booleanDetermine whether this IR is a cast operation.default booleanisCastOperation(IJavaType expectedCastType) Determine whether this IR is a cast operation to an expected type.default booleanDetermine whether this IR is a non-reference immediate.default booleanisConstantImm(long expectedRawValue) Determine whether this IR is a non-reference immediate with an expected raw value.default booleanisImm()Determine whether this IR is an immediate.default booleanDetermine whether this IR is an instance field expression.default booleanDetermine whether this IR is an instruction.default booleanDetermine whether this IR is new-array information.default booleanDetermine whether this IR is new-instance information.default booleanDetermine whether this IR is an operation.default booleanisOperation(JavaOperatorType expectedOperatorType) Determine whether this IR is an operation of the provided type.default booleanisOperation(JavaOperatorType expectedOperatorType1, JavaOperatorType expectedOperatorType2) Determine whether this IR is an operation of any of the provided types.default booleanisOperation(JavaOperatorType expectedOperatorType1, JavaOperatorType expectedOperatorType2, JavaOperatorType expectedOperatorType3) Determine whether this IR is an operation of any of the provided types.default booleanisOperation(JavaOperatorType expectedOperatorType1, JavaOperatorType expectedOperatorType2, JavaOperatorType expectedOperatorType3, JavaOperatorType expectedOperatorType4) Determine whether this IR is an operation of any of the provided types.default booleanisOperation(JavaOperatorType expectedOperatorType1, JavaOperatorType expectedOperatorType2, JavaOperatorType expectedOperatorType3, JavaOperatorType expectedOperatorType4, JavaOperatorType expectedOperatorType5) Determine whether this IR is an operation of any of the provided types.default booleanisOperation(JavaOperatorType expectedOperatorType1, JavaOperatorType expectedOperatorType2, JavaOperatorType expectedOperatorType3, JavaOperatorType expectedOperatorType4, JavaOperatorType expectedOperatorType5, JavaOperatorType expectedOperatorType6) Determine whether this IR is an operation of any of the provided types.default booleanDetermine whether this IR is a reference type expression.default booleanDetermine whether this IR is a static field expression.default booleanDetermine whether this IR is a pooled string immediate.default booleanisVar()Determine whether this IR is a variable.default booleanisVar(int wantedVarId) Determine whether this IR is a variable with an expected id.voidremoveData(String key) Remove an entry from this IR element's data map.booleanreplaceSubExpression(IDExpression target, IDExpression repl) Replace an expression of this IR.intreplaceVariable(IDVar var, IDExpression repl) Deep replace all matching variables by the provided expression.voidsetCustomCanThrow(Boolean elemenCanThrow) Set a custom override forcanThrow(IDMethodContext).Store a key-value pair in this IR element's data map.voidSet an optional origin info string for this IR element.voidsetPhysicalMethodIndex(int physicalMethodIndex) Set a low-level dex method index mapping to this IR element.voidsetPhysicalOffset(int physicalOffset) Set the main physical offset associated with this IR.booleanUpdate the type of an expression.booleanUpdate the type of an expression.booleanUpdate the type of an expression.spawn(long rawvalue) Create a new immediate IR with the provided 64-bit raw value, and the type of this IR expression.voidtransferMetadataFrom(IDExpression srcExp) Transfer (shallow copy) metadata from a source IR to this IR.voidupdateAllPhysicalMethodIndices(int physicalMethodIndex) Update the low-level dex method index mapping for this IR element and its constituents.voidupdateAllPhysicalOffsets(int physicalOffset) Update the physical offset of this element and all its constituents.voidupdateTypes(DTypeInfo ti) Deep update the types of the constituents of this IR expression and update to determine the IR type as well.booleanvisitDepthPost(IDVisitor visitor) Visit this expression and its constituents, depth-first post-order.booleanvisitDepthPost(IDVisitor visitor, IDExpression parent) Visit this expression and its constituents, depth-first post-order.booleanvisitDepthPost(IDVisitor visitor, IDExpression parent, DVisitResults results) Visit this expression and its constituents, depth-first post-order.booleanvisitDepthPre(IDVisitor visitor) Visit this expression and its constituents, depth-first pre-order.booleanvisitDepthPre(IDVisitor visitor, IDExpression parent) Visit this expression and its constituents, depth-first pre-order.booleanvisitDepthPre(IDVisitor visitor, IDExpression parent, DVisitResults results) Visit this expression and its constituents, depth-first pre-order.Methods inherited from interface com.pnfsoftware.jeb.core.units.code.android.ir.IDElement
equalsEx, format, toString, toStringMethods inherited from interface com.pnfsoftware.jeb.core.units.code.IInstructionOperand
format
-
Method Details
-
copy
Description copied from interface:IDElementCopy this element. This operation can be seen as a custom duplication; the resulting element may not be of the same type as this element.- Specified by:
copyin interfaceIDElement- Parameters:
opt- optional; if one is provided,DCopyOptions.onDup(IDExpression)will be tried first to create a copy- Returns:
- the copied element
-
duplicate
IDExpression duplicate()Description copied from interface:IDElementDuplicate this element. -
transferMetadataFrom
Transfer (shallow copy) metadata from a source IR to this IR. Currently, this includes the physical offset and the data map.- Parameters:
srcExp- source IR expression
-
setPhysicalMethodIndex
void setPhysicalMethodIndex(int physicalMethodIndex) Set a low-level dex method index mapping to this IR element. This is useful to override the default (ownerIDMethodContext's dex method), such as when a method contains inlined code from another method.- Parameters:
physicalMethodIndex- a lower-level dex method index, or -1 to signify none or the default
-
getPhysicalMethodIndex
int getPhysicalMethodIndex()Retrieve the low-level dex method index mapping to this IR element.- Returns:
- a lower-level method index, or -1 to signify the default (which is the
IDMethodContext's dex method index)
-
collectAllPhysicalMethodIndices
Collect all low-level dex method indices mapped to this IR element and its constituents.- Parameters:
physicalMethodIndices- sink for physical method indices
-
updateAllPhysicalMethodIndices
void updateAllPhysicalMethodIndices(int physicalMethodIndex) Update the low-level dex method index mapping for this IR element and its constituents.- Parameters:
physicalMethodIndex- new physical method index
-
setPhysicalOffset
void setPhysicalOffset(int physicalOffset) Set the main physical offset associated with this IR.- Parameters:
physicalOffset- an offset, -1 for none
-
getPhysicalOffset
int getPhysicalOffset()Retrieve the physical offset (dalvik) associated with this IR.- Returns:
- a dalvik method offset (in bytes); -1 if there is no offset associated with the IR
-
collectAllPhysicalOffsets
Gather all physical offsets for this element and all its constituents.- Parameters:
physicalOffsets- sink; it is recommended to provide a Set to avoid the collection of duplicates
-
updateAllPhysicalOffsets
void updateAllPhysicalOffsets(int physicalOffset) Update the physical offset of this element and all its constituents.- Parameters:
physicalOffset- new physical offset, -1 to reset (to none)
-
setData
Store a key-value pair in this IR element's data map.- Parameters:
key- mandatory keyvalue- mandatory value- Returns:
- the previous value associated with this key
-
getData
Retrieve a value from this IR element's data map.- Parameters:
key- mandatory key- Returns:
- value associated with the key, null if none
-
removeData
Remove an entry from this IR element's data map.- Parameters:
key- mandatory key
-
setOrigin
Set an optional origin info string for this IR element. Note that the origin is stored as an entry in the data map.- Parameters:
origin- optional origin string
-
getOrigin
String getOrigin()Retrieve the origin info string of this IR element, if there is one.- Returns:
- origin string, or null
-
updateTypes
Deep update the types of the constituents of this IR expression and update to determine the IR type as well.- Parameters:
ti- optional type information object, used to record type updates and conflicts
-
getType
IJavaType getType()Get the IR expression type.- Returns:
- the expression type
-
checkType
Determine whether the expression type matches an expected type.- Parameters:
wantedType- expected type- Returns:
- true if the type of the expression is as expected
-
setType
Update the type of an expression.- Parameters:
newType- mandatory new type- Returns:
- true if the type was updated, false otherwise
-
setType
Update the type of an expression.- Parameters:
newType- mandatory new typeti- optional type information object, used to record type update results- Returns:
- true if the type was updated, false otherwise
-
setType
Update the type of an expression.- Parameters:
newType- mandatory new typeti- optional type information object, used to record type update resultsforceUpdate- if true, the new type will always be set (compatibility checks are bypassed)- Returns:
- true if the type was updated, false otherwise
-
replaceVariable
Deep replace all matching variables by the provided expression. Important notes:
- Matching is done by reference equality (IDVarare factory-created, no two variables created by the same context can have the same id)
- When a replacement is to be performed, aduplicationofreplis done and used as the replacement expression to avoid reuse.
- The exploration is recursive: the constituents are explored for replacement.
- If this expression is itself an identifier, it will not be replaced; only the constituents are matched for replacement.- Parameters:
var- target variable to be replacedrepl- expression that will replace the identifier- Returns:
- the number of replacements
-
collectSubExpressions
Collect all sub-expressions of this expression, in evaluation order. If the full expression were to be evaluated at runtime, a sub-expression at indexiin the list would be evaluated before a sub-expression at indexi+1.- Parameters:
sink- collector for the sub-expressions
-
getSubExpressions
Convenience method used to retrieve all the sub-expressions of this IR, in evaluation order. UsescollectSubExpressions(Collection).- Returns:
- a list of sub-expressions
-
replaceSubExpression
Replace an expression of this IR. This method does not perform deep replacement. The target expression is compared by equality.- Parameters:
target- IR expression to be replacedrepl- replacement expression- Returns:
- true if the target was successfully replaced
-
collectVarIds
Recursively collect all the variable ids used and defined by this expression.- Parameters:
sink- collection receiving the variable ids
-
getVarIds
Recursively collect all the variable ids used and defined by this expression.- Returns:
- a set of unique variable ids
-
countVariable
Count how many times a given identifier is present in an expression. Matching is done usingsame.- Parameters:
var- a variable- Returns:
- the number of occurrences of this variable in this IR expression
-
setCustomCanThrow
Set a custom override forcanThrow(IDMethodContext). If one is set,canThrow(IDMethodContext)will return the override value instead of performing regular verifications to determine whether the IR element may raise.Note: Currently, the custom value is only supported by
IDArrayElt.- Parameters:
elemenCanThrow- custom value, null to reset
-
getCustomCanThrow
Boolean getCustomCanThrow()Retrieve the custom override set forcanThrow(IDMethodContext). SeesetCustomCanThrow(Boolean)for details.Note: Currently, the custom value is only supported by
IDArrayElt.- Returns:
- the custom value, or null if none was set
-
canThrow
Determine whether a hypothetical execution of this IR expression could throw.This method is not fail-safe, it works on a best-effort basis.
- Parameters:
ctx- mandatory method context- Returns:
- true if the expression may have side effects
-
hasSideEffects
Determine whether a hypothetical execution of this IR expression would change the program internal state.This method is not fail-safe, it works on a best-effort basis.
- Parameters:
ctx- method contextincludeCanThrow- if true, the possibility of this IR to raise exceptions is checked and considered to be a side-effect- Returns:
- true if the expression may throw
-
evaluate
Evaluate this expression.Note about evaluating instructions: When evaluating an
IDInstruction, a context and frame must be present in the state. The value of PC is not directly updated after the execution of this instruction. Instead, the next expected PC is stored in the current frame, and can be retrieved viaIDEmuFrame.getNextPC(). Only the evaluation ofASSIGN,RETURN,INVOKEIR instructions may return a value; else, the method will return null.To perform emulation of a stub of IR with full controls, use methods in
IDStatedirectly.- Parameters:
state- a machine state- Returns:
- the evaluated expression (be careful, it may be a
reference-immediate!) - Throws:
DexDecEvaluationException- on evaluation error
-
evaluate
Convenience method: Evaluate this expression within the context of the provided method.See important note in
evaluate(IDState).- Parameters:
ctx- method context- Returns:
- the evaluated expression (be careful, it may be a
reference-immediate!) - Throws:
DexDecEvaluationException- on evaluation error
-
evaluate
Convenience method: evaluate anon-instructionIR expression using the provided set a variable values.- Parameters:
g- global IR contextvarmap- a map of variable values to be used when evaluating the expression- Returns:
- the evaluation result (be careful, it may be a
reference-immediate!) - Throws:
DexDecEvaluationException- on evaluation error
-
generateAST
Generate the Java AST element for this IR expression.- Parameters:
ctx- IR method context (of which this IR element belongs)m- AST Method context (of which the resulting AST element will belong)- Returns:
- the generated AST element
-
spawn
Create a new immediate IR with the provided 64-bit raw value, and the type of this IR expression.- Parameters:
rawvalue- raw bits- Returns:
- the new immediate
-
visitDepthPre
Visit this expression and its constituents, depth-first pre-order.If the visitor replaces an element, the new element must be specified by calling
setReplacedNode().- Parameters:
visitor- visitor object- Returns:
- success indicator; true unless a different value was specified in
DVisitResultswhen visiting an element
-
visitDepthPre
Visit this expression and its constituents, depth-first pre-order.If the visitor replaces an element, the new element must be specified by calling
setReplacedNode().- Parameters:
visitor- visitor objectparent- the optional parent of this expression- Returns:
- success indicator; true unless a different value was specified in
DVisitResultswhen visiting an element
-
visitDepthPre
Visit this expression and its constituents, depth-first pre-order.If the visitor replaces an element, the new element must be specified by calling
setReplacedNode().- Parameters:
visitor- visitor objectparent- the optional parent of this expressionresults- an optional result object provided to the visitor, containing flags used to customize the visiting process- Returns:
- success indicator; true unless a different value was specified in
DVisitResultswhen visiting an element
-
visitDepthPost
Visit this expression and its constituents, depth-first post-order.- Parameters:
visitor- visitor object- Returns:
- success indicator; true unless a different value was specified in
DVisitResultswhen visiting an element
-
visitDepthPost
Visit this expression and its constituents, depth-first post-order.- Parameters:
visitor- visitor objectparent- the optional parent of this expression- Returns:
- success indicator; true unless a different value was specified in
DVisitResultswhen visiting an element
-
visitDepthPost
Visit this expression and its constituents, depth-first post-order.- Parameters:
visitor- visitor objectparent- the optional parent of this expressionresults- an optional result object provided to the visitor, containing flags used to customize the visiting process- Returns:
- success indicator; true unless a different value was specified in
DVisitResultswhen visiting an element
-
findParent
Find the parent of the first instance of the provided child element. The comparison is done by identity.- Parameters:
elt- an IR element; if the element isthis, the method will return null- Returns:
- the parent or null
-
findParent
Find the parent of the the provided child element. The comparison is done by identity.- Parameters:
elt- an IR element; if the element isthis, the method will return nullstart- count of instances ofeltthat should be skipped before returning the parent element; this is useful is the element provided may not be unique within the tree (e.g. var)- Returns:
- the parent or null
-
find
Couple<IDExpression,IDExpression> find(IDExpression elt, int start, int comparisonMethod, IDExpression thisParent) Find the parent of the the provided child element.- Parameters:
elt- an IR element; if the element isthis, the method will return nullstart- count of instances ofeltthat should be skipped before returning the parent element; this is useful is the element provided may not be unique within the tree (e.g. var)comparisonMethod- 0= identity, 1= equality, 2= type-less equalitythisParent- optional parent of this IR element- Returns:
- if found, the pair (parent, element) parent; else, null
-
findByType
Find the first child element by type.- Type Parameters:
T- expected element type- Parameters:
clazz- type of the element to be found; careful, if the type is the one ofthis, then this object will be returned- Returns:
- the element or null
-
findByType
Find a child element by type.- Type Parameters:
T- expected element type- Parameters:
clazz- type of the element to be found; careful, if the type is the one ofthis, then this object will be returnedstart- count of matched elements that should be skipped before returning the element- Returns:
- the element or null
-
isInstruction
default boolean isInstruction()Determine whether this IR is an instruction.- Returns:
- true if this IR is an
IDInstruction
-
asInstruction
Cast this IR to an instruction.- Returns:
- this IR as an
IDInstruction
-
isArrayElt
default boolean isArrayElt()Determine whether this IR is an array element.- Returns:
- true if this IR is an
IDArrayElt
-
asArrayElt
Cast this IR to an array element.- Returns:
- this IR as an
IDArrayElt
-
isReferenceType
default boolean isReferenceType()Determine whether this IR is a reference type expression.- Returns:
- true if this IR is an
IDReferenceType
-
asReferenceType
Cast this IR to a reference type expression.- Returns:
- this IR as an
IDReferenceType
-
isInstanceField
default boolean isInstanceField()Determine whether this IR is an instance field expression.- Returns:
- true if this IR is an
IDInstanceField
-
asInstanceField
Cast this IR to an instance field expression.- Returns:
- this IR as an
IDInstanceField
-
isStaticField
default boolean isStaticField()Determine whether this IR is a static field expression.- Returns:
- true if this IR is an
IDStaticField
-
asStaticField
Cast this IR to a static field expression.- Returns:
- this IR as an
IDStaticField
-
isOperation
default boolean isOperation()Determine whether this IR is an operation.- Returns:
- true if this IR is an
IDOperation
-
isOperation
Determine whether this IR is an operation of the provided type.- Parameters:
expectedOperatorType- an operator type- Returns:
- true if this IR is an
operationof the provided type
-
isOperation
default boolean isOperation(JavaOperatorType expectedOperatorType1, JavaOperatorType expectedOperatorType2) Determine whether this IR is an operation of any of the provided types.- Parameters:
expectedOperatorType1- an operator typeexpectedOperatorType2- an operator type- Returns:
- true if this IR is an
operationof any of the provided types
-
isOperation
default boolean isOperation(JavaOperatorType expectedOperatorType1, JavaOperatorType expectedOperatorType2, JavaOperatorType expectedOperatorType3) Determine whether this IR is an operation of any of the provided types.- Parameters:
expectedOperatorType1- an operator typeexpectedOperatorType2- an operator typeexpectedOperatorType3- an operator type- Returns:
- true if this IR is an
operationof any of the provided types
-
isOperation
default boolean isOperation(JavaOperatorType expectedOperatorType1, JavaOperatorType expectedOperatorType2, JavaOperatorType expectedOperatorType3, JavaOperatorType expectedOperatorType4) Determine whether this IR is an operation of any of the provided types.- Parameters:
expectedOperatorType1- an operator typeexpectedOperatorType2- an operator typeexpectedOperatorType3- an operator typeexpectedOperatorType4- an operator type- Returns:
- true if this IR is an
operationof any of the provided types
-
isOperation
default boolean isOperation(JavaOperatorType expectedOperatorType1, JavaOperatorType expectedOperatorType2, JavaOperatorType expectedOperatorType3, JavaOperatorType expectedOperatorType4, JavaOperatorType expectedOperatorType5) Determine whether this IR is an operation of any of the provided types.- Parameters:
expectedOperatorType1- an operator typeexpectedOperatorType2- an operator typeexpectedOperatorType3- an operator typeexpectedOperatorType4- an operator typeexpectedOperatorType5- an operator type- Returns:
- true if this IR is an
operationof any of the provided types
-
isOperation
default boolean isOperation(JavaOperatorType expectedOperatorType1, JavaOperatorType expectedOperatorType2, JavaOperatorType expectedOperatorType3, JavaOperatorType expectedOperatorType4, JavaOperatorType expectedOperatorType5, JavaOperatorType expectedOperatorType6) Determine whether this IR is an operation of any of the provided types.- Parameters:
expectedOperatorType1- an operator typeexpectedOperatorType2- an operator typeexpectedOperatorType3- an operator typeexpectedOperatorType4- an operator typeexpectedOperatorType5- an operator typeexpectedOperatorType6- an operator type- Returns:
- true if this IR is an
operationof any of the provided types
-
isCastOperation
default boolean isCastOperation()Determine whether this IR is a cast operation.- Returns:
- true if this IR is a cast
operation
-
isCastOperation
Determine whether this IR is a cast operation to an expected type.- Parameters:
expectedCastType- wanted cast type- Returns:
- true if this IR is an
operationcasting to the wanted type
-
asOperation
Cast this IR to an operation.- Returns:
- this IR as an
IDOperation
-
isCallInfo
default boolean isCallInfo()Determine whether this IR is call information.- Returns:
- true if this IR is an
IDCallInfoor its sub-typeIDNewInfo
-
isCallInfo
Determine whether this IR is call information for a method signature.- Parameters:
wantedMsig- wanted method signature- Returns:
- true if this IR is an
IDCallInfoor its sub-typeIDNewInfoinvoking the provided method signature
-
asCallInfo
Cast this IR to call information.- Returns:
- this IR as an
IDCallInfo
-
isNewInfo
default boolean isNewInfo()Determine whether this IR is new-instance information.- Returns:
- true if this IR is an
IDNewInfo
-
asNewInfo
Cast this IR to new-instance information.- Returns:
- this IR as an
IDNewInfo
-
isNewArrayInfo
default boolean isNewArrayInfo()Determine whether this IR is new-array information.- Returns:
- true if this IR is an
IDNewArrayInfo
-
asNewArrayInfo
Cast this IR to new-array information.- Returns:
- this IR as an
IDNewArrayInfo
-
isImm
default boolean isImm()Determine whether this IR is an immediate.- Returns:
- true if this IR is an
IDImm
-
isConstantImm
default boolean isConstantImm()Determine whether this IR is a non-reference immediate.- Returns:
- true if this IR is an
IDImmholding a non-reference immediate, that is, a primitive value or a pooled string. (For references, including the null references, this method will return false.)
-
isConstantImm
default boolean isConstantImm(long expectedRawValue) Determine whether this IR is a non-reference immediate with an expected raw value.- Parameters:
expectedRawValue- wanted value- Returns:
- true if this IR is an
IDImmholding a non-reference immediate with the provided raw value
-
isStringImm
default boolean isStringImm()Determine whether this IR is a pooled string immediate.- Returns:
- true if this IR is an
IDImmholding a pooled String constant. (String references are not constants.)
-
asImm
Cast this IR to an immediate.- Returns:
- this IR as an
IDImm
-
isVar
default boolean isVar()Determine whether this IR is a variable.- Returns:
- true if this IR is an
IDVar
-
isVar
default boolean isVar(int wantedVarId) Determine whether this IR is a variable with an expected id.- Parameters:
wantedVarId- a variable id- Returns:
- true if this IR is a
variablehaving the provided id
-
asVar
Cast this IR to a variable.- Returns:
- this IR as an
IDVar
-