DalvInsnList instance.
| Modifier and Type | Field and Description |
|---|---|
| private final DexOptions | dexOptions
|
| private boolean | hasAnyLocalInfo
whether any instruction has local variable info |
| private boolean | hasAnyPositionInfo
whether any instruction has position info |
| private ArrayList | insns
|
| private int | reservedCount
|
| private final int | unreservedRegCount
|
| Access | Constructor and Description |
|---|---|
| public | OutputFinisher(DexOptions
non-null; options for dex output>= 0; initial capacity of the
instructions list>= 0; register count for the methodConstructs an instance. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| private static void | addConstants(HashSet<Constant>
non-null; result set to add tonon-null; instruction to scrutinizeHelper for |
| private static void | addConstants(HashSet<Constant>
non-null; result set to add tonull-ok; register spec to addHelper for |
| private void | assignAddresses()
Helper for |
| private void | assignAddressesAndFixBranches()
Helper for |
| public void | assignIndices(DalvCode.
non-null; callback objectAssigns indices in all instructions that need them, using the given callback to perform lookups. |
| private static void | assignIndices(CstInsn
non-null; the instructionnon-null; the callbackHelper for |
| private int | Returns: >= 0; the count of reserved registersnon-null; array of per-instruction
opcode selectionsHelper for |
| private Dop | Returns: non-null; the opcode that fitsnon-null; the instruction in questionFinds the proper opcode for the given instruction, ignoring register constraints. |
| private Dop | Returns: null-ok; a possibly-different opcode; either a
non-null good fit or null to indicate that no
simple opcode fitsnon-null; the instruction in questionnull-ok; the current guess as to the best
opcode; null means that no simple opcode fitsAttempts to fit the given instruction into a specific opcode,
returning the opcode whose format that the instruction fits
into or |
| public DalvInsnList | Returns: non-null; the output listDoes final processing on this instance and gets the output as
a |
| private boolean | Returns: whether any branches had to be fixedHelper for |
| public HashSet | Returns: non-null; the set of constantsReturns the set of all constants referred to by instructions added to this instance. |
| public boolean | Returns: whether this instance has any local variable informationReturns whether this instance has any local variable information. |
| public boolean | Returns: whether any of the instructions added to this instance come with position infoReturns whether any of the instructions added to this instance come with position info. |
| private static boolean | Returns: true iff the instruction refers to any
named localsnon-null; instruction to scrutinizeHelper for |
| private static boolean | Returns: true iff the spec refers to any
named localsnon-null; spec to scrutinizeHelper for |
| public void | |
| private Dop[] | Returns: non-null; the array of opcodesHelper for |
| private void | massageInstructions(Dop[]
non-null; array of per-instruction
opcode selectionsHelper for |
| private ArrayList | Returns: non-null; the replacement listnon-null; array of per-instruction
opcode selectionsHelper for |
| private void | reserveRegisters(Dop[]
non-null; array of per-instruction
opcode selectionsHelper for |
| public void | reverseBranch(int
how many instructions back to find the branch;
which, CodeAddress 0 is the most recently added instruction,
1 is the instruction before that, etc.non-null; the new target for the
reversed branchReverses a branch which is buried a given number of instructions backward in the output. |
| private void | updateInfo(DalvInsn
non-null; an instruction that was just introducedHelper for |
| dexOptions | back to summary |
|---|---|
| private final DexOptions dexOptions
| |
| hasAnyLocalInfo | back to summary |
|---|---|
| private boolean hasAnyLocalInfo whether any instruction has local variable info | |
| hasAnyPositionInfo | back to summary |
|---|---|
| private boolean hasAnyPositionInfo whether any instruction has position info | |
| insns | back to summary |
|---|---|
| private ArrayList<DalvInsn> insns
| |
| reservedCount | back to summary |
|---|---|
| private int reservedCount
| |
| unreservedRegCount | back to summary |
|---|---|
| private final int unreservedRegCount
| |
| OutputFinisher | back to summary |
|---|---|
| public OutputFinisher(DexOptions dexOptions, int initialCapacity, int regCount) Constructs an instance. It initially contains no instructions.
| |
| add | back to summary |
|---|---|
| public void add(DalvInsn insn) Adds an instruction to the output.
| |
| addConstants | back to summary |
|---|---|
| private static void addConstants(HashSet<Constant> result, DalvInsn insn) Helper for | |
| addConstants | back to summary |
|---|---|
| private static void addConstants(HashSet<Constant> result, RegisterSpec spec) Helper for
| |
| assignAddresses | back to summary |
|---|---|
| private void assignAddresses() Helper for | |
| assignAddressesAndFixBranches | back to summary |
|---|---|
| private void assignAddressesAndFixBranches() Helper for | |
| assignIndices | back to summary |
|---|---|
| public void assignIndices(DalvCode. Assigns indices in all instructions that need them, using the
given callback to perform lookups. This should be called before
calling
| |
| assignIndices | back to summary |
|---|---|
| private static void assignIndices(CstInsn insn, DalvCode. Helper for
| |
| calculateReservedCount | back to summary |
|---|---|
| private int calculateReservedCount(Dop[] opcodes) Helper for
| |
| findExpandedOpcodeForInsn | back to summary |
|---|---|
| private Dop findExpandedOpcodeForInsn(DalvInsn insn) Finds the proper opcode for the given instruction, ignoring register constraints. | |
| findOpcodeForInsn | back to summary |
|---|---|
| private Dop findOpcodeForInsn(DalvInsn insn, Dop guess) Attempts to fit the given instruction into a specific opcode,
returning the opcode whose format that the instruction fits
into or | |
| finishProcessingAndGetList | back to summary |
|---|---|
| public DalvInsnList finishProcessingAndGetList() Does final processing on this instance and gets the output as
a
Note This method may only be called once per instance of this class.
| |
| fixBranches | back to summary |
|---|---|
| private boolean fixBranches() Helper for
| |
| getAllConstants | back to summary |
|---|---|
| public HashSet Returns the set of all constants referred to by instructions added to this instance. | |
| hasAnyLocalInfo | back to summary |
|---|---|
| public boolean hasAnyLocalInfo() Returns whether this instance has any local variable information.
| |
| hasAnyPositionInfo | back to summary |
|---|---|
| public boolean hasAnyPositionInfo() Returns whether any of the instructions added to this instance come with position info.
| |
| hasLocalInfo | back to summary |
|---|---|
| private static boolean hasLocalInfo(DalvInsn insn) Helper for
| |
| hasLocalInfo | back to summary |
|---|---|
| private static boolean hasLocalInfo(RegisterSpec spec) Helper for
| |
| insert | back to summary |
|---|---|
| public void insert(int at, DalvInsn insn) Inserts an instruction in the output at the given offset.
| |
| makeOpcodesArray | back to summary |
|---|---|
| private Dop[] makeOpcodesArray() Helper for
| |
| massageInstructions | back to summary |
|---|---|
| private void massageInstructions(Dop[] opcodes) Helper for This method may also reserve a number of low-numbered registers, renumbering the instructions' original registers, in order to have register space available in which to move very-high registers when expanding instructions into multi-instruction sequences. This expansion is done when no simple instruction format can be found for a given instruction that is able to accomodate that instruction's registers. This method ignores issues of branch target size, since final addresses aren't known at the point that this method is called.
| |
| performExpansion | back to summary |
|---|---|
| private ArrayList Helper for | |
| reserveRegisters | back to summary |
|---|---|
| private void reserveRegisters(Dop[] opcodes) Helper for
| |
| reverseBranch | back to summary |
|---|---|
| public void reverseBranch(int which, CodeAddress newTarget) Reverses a branch which is buried a given number of instructions backward in the output. It is illegal to call this unless the indicated instruction really is a reversible branch.
| |
| updateInfo | back to summary |
|---|---|
| private void updateInfo(DalvInsn insn) Helper for
| |