public class AnalyzedInstruction extends java.lang.Object implements java.lang.Comparable<AnalyzedInstruction>
| Modifier and Type | Field and Description |
|---|---|
protected Instruction |
instruction
The actual instruction
|
protected int |
instructionIndex
The index of the instruction, where the first instruction in the method is at index 0, and so on
|
protected MethodAnalyzer |
methodAnalyzer
The MethodAnalyzer containing this instruction
|
protected Instruction |
originalInstruction
When deodexing, we might need to deodex this instruction multiple times, when we merge in new register
information.
|
protected RegisterType[] |
postRegisterMap
This contains the register types *after* the instruction has executed
|
protected java.util.Map<org.jf.dexlib2.analysis.AnalyzedInstruction.PredecessorOverrideKey,RegisterType> |
predecessorRegisterOverrides
This contains optional register type overrides for register types from predecessors
|
protected java.util.TreeSet<AnalyzedInstruction> |
predecessors
Instructions that can pass on execution to this one during normal execution
|
protected RegisterType[] |
preRegisterMap
This contains the register types *before* the instruction has executed
|
protected java.util.LinkedList<AnalyzedInstruction> |
successors
Instructions that can execution could pass on to next during normal execution
|
| Constructor and Description |
|---|
AnalyzedInstruction(MethodAnalyzer methodAnalyzer,
Instruction instruction,
int instructionIndex,
int registerCount) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
addPredecessor(AnalyzedInstruction predecessor) |
protected void |
addSuccessor(AnalyzedInstruction successor) |
int |
compareTo(AnalyzedInstruction analyzedInstruction) |
int |
getDestinationRegister() |
Instruction |
getInstruction() |
int |
getInstructionIndex() |
protected RegisterType |
getMergedPreRegisterTypeFromPredecessors(int registerNumber)
Iterates over the predecessors of this instruction, and merges all the post-instruction register types for the
given register.
|
Instruction |
getOriginalInstruction() |
RegisterType |
getPostInstructionRegisterType(int registerNumber) |
int |
getPredecessorCount() |
RegisterType |
getPredecessorRegisterType(AnalyzedInstruction predecessor,
int registerNumber) |
java.util.SortedSet<AnalyzedInstruction> |
getPredecessors() |
RegisterType |
getPreInstructionRegisterType(int registerNumber) |
int |
getRegisterCount() |
java.util.List<java.lang.Integer> |
getSetRegisters() |
java.util.List<AnalyzedInstruction> |
getSuccessors() |
boolean |
isBeginningInstruction()
Is this instruction a "beginning instruction".
|
boolean |
isInvokeInit() |
protected boolean |
mergeRegister(int registerNumber,
RegisterType registerType,
java.util.BitSet verifiedInstructions,
boolean override) |
protected boolean |
overridePredecessorRegisterType(AnalyzedInstruction predecessor,
int registerNumber,
RegisterType registerType,
java.util.BitSet verifiedInstructions)
Adds an override for a register type from a predecessor.
|
protected void |
restoreOdexedInstruction() |
protected void |
setDeodexedInstruction(Instruction instruction) |
protected boolean |
setPostRegisterType(int registerNumber,
RegisterType registerType)
Sets the "post-instruction" register type as indicated.
|
boolean |
setsRegister(int registerNumber)
Determines if this instruction sets the given register, or alters its type
|
@Nonnull protected final MethodAnalyzer methodAnalyzer
@Nonnull protected Instruction instruction
protected final int instructionIndex
@Nonnull protected final java.util.TreeSet<AnalyzedInstruction> predecessors
@Nonnull protected final java.util.LinkedList<AnalyzedInstruction> successors
@Nonnull protected final RegisterType[] preRegisterMap
@Nonnull protected final RegisterType[] postRegisterMap
@Nullable protected java.util.Map<org.jf.dexlib2.analysis.AnalyzedInstruction.PredecessorOverrideKey,RegisterType> predecessorRegisterOverrides
protected final Instruction originalInstruction
public AnalyzedInstruction(@Nonnull
MethodAnalyzer methodAnalyzer,
@Nonnull
Instruction instruction,
int instructionIndex,
int registerCount)
public int getInstructionIndex()
public int getPredecessorCount()
public java.util.SortedSet<AnalyzedInstruction> getPredecessors()
public RegisterType getPredecessorRegisterType(@Nonnull AnalyzedInstruction predecessor, int registerNumber)
protected boolean addPredecessor(AnalyzedInstruction predecessor)
protected void addSuccessor(AnalyzedInstruction successor)
protected void setDeodexedInstruction(Instruction instruction)
protected void restoreOdexedInstruction()
@Nonnull public java.util.List<AnalyzedInstruction> getSuccessors()
@Nonnull public Instruction getInstruction()
@Nonnull public Instruction getOriginalInstruction()
public boolean isBeginningInstruction()
protected boolean mergeRegister(int registerNumber,
RegisterType registerType,
java.util.BitSet verifiedInstructions,
boolean override)
@Nonnull protected RegisterType getMergedPreRegisterTypeFromPredecessors(int registerNumber)
registerNumber - the register numberprotected boolean setPostRegisterType(int registerNumber,
RegisterType registerType)
registerNumber - Which register to setregisterType - The "post-instruction" register typeprotected boolean overridePredecessorRegisterType(@Nonnull
AnalyzedInstruction predecessor,
int registerNumber,
@Nonnull
RegisterType registerType,
java.util.BitSet verifiedInstructions)
predecessor - Which predecessor is being overriddenregisterNumber - The register number of the register being overriddenregisterType - The overridden register typeverifiedInstructions - A bit vector of instructions that have been verifiedpublic boolean isInvokeInit()
public boolean setsRegister(int registerNumber)
registerNumber - The register to checkpublic java.util.List<java.lang.Integer> getSetRegisters()
public int getDestinationRegister()
public int getRegisterCount()
@Nonnull public RegisterType getPostInstructionRegisterType(int registerNumber)
@Nonnull public RegisterType getPreInstructionRegisterType(int registerNumber)
public int compareTo(@Nonnull
AnalyzedInstruction analyzedInstruction)
compareTo in interface java.lang.Comparable<AnalyzedInstruction>