| Modifier and Type | Class and Description |
|---|---|
| private class | RopTranslator.
Instruction visitor class for doing instruction translation with local variable tracking |
| private class | RopTranslator.
Instruction visitor class for doing the instruction translation per se. |
| Modifier and Type | Field and Description |
|---|---|
| private final BlockAddresses | addresses
|
| private final DexOptions | dexOptions
|
| private final LocalVariableInfo | locals
|
| private final RopMethod | method
|
| private int[] | |
| private final OutputCollector | output
|
| private boolean | paramsAreInOrder
true if the parameters to this method happen to be in proper order at the end of the frame (as the optimizer emits them) |
| private final int | paramSize
size, in register units, of all the parameters to this method |
| private final int | positionInfo
how much position info to preserve; one of the static
constants in |
| private final int | regCount
|
| private final RopTranslator. | translationVisitor
|
| Access | Constructor and Description |
|---|---|
| private | RopTranslator(RopMethod
non-null; the original methodhow much position info to preserve; one of the
static constants in positionInfo, LocalVariableInfo PositionListnull-ok; local variable information to usesize, in register units, of all the parameters to
this method paramSize, DexOptions non-null; options for dex outputConstructs an instance. |
| Modifier and Type | Method and Description |
|---|---|
| private static boolean | calculateParamsAreInOrder(RopMethod method, final int
size, in register units, of all the parameters
to this method paramSize)Checks to see if the move-param instructions that occur in this method happen to slot the params in an order at the top of the stack frame that matches dalvik's calling conventions. |
| private static RegisterSpecList | |
| private static RegisterSpecList | Returns: non-null; the instruction's complete register listnon-null; instruction in questionnull-ok; the real result to use (ignore the insn's)Gets the complete register list (result and sources) out of a given rop instruction. |
| private void | outputBlock(BasicBlock
non-null; the block to process and output>= -1; the next block that will be processed, or
-1 if there is no next blockHelper for |
| private void | |
| private void | |
| public static DalvCode | Returns: non-null; the translated versionnon-null; the original methodhow much position info to preserve; one of the
static constants in positionInfo, LocalVariableInfo PositionListnull-ok; local variable information to usesize, in register units, of all the parameters to
this method paramSize, DexOptions non-null; options for dex outputTranslates a |
| private DalvCode |
| addresses | back to summary |
|---|---|
| private final BlockAddresses addresses
| |
| dexOptions | back to summary |
|---|---|
| private final DexOptions dexOptions
| |
| locals | back to summary |
|---|---|
| private final LocalVariableInfo locals
| |
| method | back to summary |
|---|---|
| private final RopMethod method
| |
| order | back to summary |
|---|---|
| private int[] order
| |
| output | back to summary |
|---|---|
| private final OutputCollector output
| |
| paramsAreInOrder | back to summary |
|---|---|
| private boolean paramsAreInOrder true if the parameters to this method happen to be in proper order at the end of the frame (as the optimizer emits them) | |
| paramSize | back to summary |
|---|---|
| private final int paramSize size, in register units, of all the parameters to this method | |
| positionInfo | back to summary |
|---|---|
| private final int positionInfo how much position info to preserve; one of the static
constants in | |
| regCount | back to summary |
|---|---|
| private final int regCount
| |
| translationVisitor | back to summary |
|---|---|
| private final RopTranslator.
| |
| RopTranslator | back to summary |
|---|---|
| private RopTranslator(RopMethod method, int positionInfo, LocalVariableInfo locals, int paramSize, DexOptions dexOptions) Constructs an instance. This method is private. Use
| |
| calculateParamsAreInOrder | back to summary |
|---|---|
| private static boolean calculateParamsAreInOrder(RopMethod method, final int paramSize) Checks to see if the move-param instructions that occur in this method happen to slot the params in an order at the top of the stack frame that matches dalvik's calling conventions. This will alway result in "true" for methods that have run through the SSA optimizer.
| |
| getRegs | back to summary |
|---|---|
| private static RegisterSpecList getRegs(Insn insn) Gets the complete register list (result and sources) out of a given rop instruction. For insns that are commutative, have two register sources, and have a source equal to the result, place that source first.
| |
| getRegs | back to summary |
|---|---|
| private static RegisterSpecList getRegs(Insn insn, RegisterSpec resultReg) Gets the complete register list (result and sources) out of a given rop instruction. For insns that are commutative, have two register sources, and have a source equal to the result, place that source first.
| |
| outputBlock | back to summary |
|---|---|
| private void outputBlock(BasicBlock block, int nextLabel) Helper for
| |
| outputInstructions | back to summary |
|---|---|
| private void outputInstructions() Performs initial creation of output instructions based on the original blocks. | |
| pickOrder | back to summary |
|---|---|
| private void pickOrder() Picks an order for the blocks by doing "trace" analysis. | |
| translate | back to summary |
|---|---|
| public static DalvCode translate(RopMethod method, int positionInfo, LocalVariableInfo locals, int paramSize, DexOptions dexOptions) Translates a
| |
| translateAndGetResult | back to summary |
|---|---|
| private DalvCode translateAndGetResult() Does the translation and returns the result.
| |
| Modifier and Type | Field and Description |
|---|---|
| private LocalVariableInfo | locals
|
| Access | Constructor and Description |
|---|---|
| public | LocalVariableAwareTranslationVisitor(OutputCollector
non-null; destination for instruction outputnon-null; the local variable infoConstructs an instance. |
| locals | back to summary |
|---|---|
| private LocalVariableInfo locals
| |
| LocalVariableAwareTranslationVisitor | back to summary |
|---|---|
| public LocalVariableAwareTranslationVisitor(OutputCollector output, LocalVariableInfo locals) Constructs an instance.
| |
| addIntroductionIfNecessary | back to summary |
|---|---|
| public void addIntroductionIfNecessary(Insn insn) Adds a
| |
| visitPlainCstInsn | back to summary |
|---|---|
| public void visitPlainCstInsn(PlainCstInsn insn) Overrides org. Implements org. Doc from org. Visits a
| |
| visitPlainInsn | back to summary |
|---|---|
| public void visitPlainInsn(PlainInsn insn) Overrides org. Implements org. Doc from org. Visits a
| |
| visitSwitchInsn | back to summary |
|---|---|
| public void visitSwitchInsn(SwitchInsn insn) Overrides org. Implements org. Doc from org. Visits a
| |
| visitThrowingCstInsn | back to summary |
|---|---|
| public void visitThrowingCstInsn(ThrowingCstInsn insn) Overrides org. Implements org. Doc from org. Visits a
| |
| visitThrowingInsn | back to summary |
|---|---|
| public void visitThrowingInsn(ThrowingInsn insn) Overrides org. Implements org. Doc from org. Visits a
| |
| Modifier and Type | Field and Description |
|---|---|
| private BasicBlock | block
|
| private CodeAddress | lastAddress
|
| private final OutputCollector | output
|
| Access | Constructor and Description |
|---|---|
| public | TranslationVisitor(OutputCollector
non-null; destination for instruction outputConstructs an instance. |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| protected void | |
| private RegisterSpec | Returns: null-ok; result of move-result-pseudo at the beginning of
primary successorLooks forward to the current block's primary successor, returning the RegisterSpec of the result of the move-result-pseudo at the top of that block or null if none. |
| public void | setBlock(BasicBlock
non-null; the blocknon-null; code address for the salient
last instruction of the blockSets the block currently being worked on. |
| public void | visitFillArrayDataInsn(FillArrayDataInsn
non-null; the instruction to visitImplements org. FillArrayDataInsn.
|
| public void | visitPlainCstInsn(PlainCstInsn
non-null; the instruction to visitImplements org. PlainCstInsn.
|
| public void | visitPlainInsn(PlainInsn
non-null; the instruction to visitImplements org. PlainInsn.
|
| public void | visitSwitchInsn(SwitchInsn
non-null; the instruction to visitImplements org. SwitchInsn.
|
| public void | visitThrowingCstInsn(ThrowingCstInsn
non-null; the instruction to visitImplements org. ThrowingCstInsn.
|
| public void | visitThrowingInsn(ThrowingInsn
non-null; the instruction to visitImplements org. ThrowingInsn.
|
| block | back to summary |
|---|---|
| private BasicBlock block
| |
| lastAddress | back to summary |
|---|---|
| private CodeAddress lastAddress
| |
| output | back to summary |
|---|---|
| private final OutputCollector output
| |
| TranslationVisitor | back to summary |
|---|---|
| public TranslationVisitor(OutputCollector output) Constructs an instance.
| |
| addOutput | back to summary |
|---|---|
| protected void addOutput(DalvInsn insn) Adds to the output.
| |
| addOutputSuffix | back to summary |
|---|---|
| protected void addOutputSuffix(DalvInsn insn) Adds to the output suffix.
| |
| getNextMoveResultPseudo | back to summary |
|---|---|
| private RegisterSpec getNextMoveResultPseudo() Looks forward to the current block's primary successor, returning the RegisterSpec of the result of the move-result-pseudo at the top of that block or null if none.
| |
| setBlock | back to summary |
|---|---|
| public void setBlock(BasicBlock block, CodeAddress lastAddress) Sets the block currently being worked on.
| |
| visitFillArrayDataInsn | back to summary |
|---|---|
| public void visitFillArrayDataInsn(FillArrayDataInsn insn) Implements org. Doc from org. Visits a
| |
| visitPlainCstInsn | back to summary |
|---|---|
| public void visitPlainCstInsn(PlainCstInsn insn) Implements org. Doc from org. Visits a
| |
| visitPlainInsn | back to summary |
|---|---|
| public void visitPlainInsn(PlainInsn insn) Implements org. Doc from org. Visits a
| |
| visitSwitchInsn | back to summary |
|---|---|
| public void visitSwitchInsn(SwitchInsn insn) Implements org. Doc from org. Visits a
| |
| visitThrowingCstInsn | back to summary |
|---|---|
| public void visitThrowingCstInsn(ThrowingCstInsn insn) Implements org. Doc from org. Visits a
| |
| visitThrowingInsn | back to summary |
|---|---|
| public void visitThrowingInsn(ThrowingInsn insn) Implements org. Doc from org. Visits a
| |