public final class OutputCollector
extends java.lang.Object
DalvInsn instances being output. This class
receives and collects instructions in two pieces — a primary
list and a suffix (generally consisting of adjunct data referred to
by the primary list, such as switch case tables) — which it
merges and emits back out in the form of a DalvInsnList
instance.| Constructor and Description |
|---|
OutputCollector(DexOptions dexOptions,
int initialCapacity,
int suffixInitialCapacity,
int regCount,
int paramSize)
Constructs an instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(DalvInsn insn)
Adds an instruction to the output.
|
void |
addSuffix(DalvInsn insn)
Adds an instruction to the output suffix.
|
DalvInsn |
get(int at) |
OutputFinisher |
getFinisher()
Gets the results of all the calls on this instance, in the form of
an
OutputFinisher. |
void |
reverseBranch(int which,
CodeAddress newTarget)
Reverses a branch which is buried a given number of instructions
backward in the output.
|
int |
size() |
public OutputCollector(DexOptions dexOptions, int initialCapacity, int suffixInitialCapacity, int regCount, int paramSize)
dexOptions - non-null; options for dex outputinitialCapacity - >= 0; initial capacity of the output listsuffixInitialCapacity - >= 0; initial capacity of the output
suffixregCount - >= 0; register count for the methodparamSize - size, in register units, of all the parameters for this methodpublic void add(DalvInsn insn)
insn - non-null; the instruction to addpublic DalvInsn get(int at)
public int size()
public void reverseBranch(int which,
CodeAddress newTarget)
which - how many instructions back to find the branch;
0 is the most recently added instruction,
1 is the instruction before that, etc.newTarget - non-null; the new target for the reversed branchpublic void addSuffix(DalvInsn insn)
insn - non-null; the instruction to addpublic OutputFinisher getFinisher()
OutputFinisher.non-null; the output finisherjava.lang.UnsupportedOperationException - if this method has
already been calledCopyright © 2020. All Rights Reserved.