Top Description Methods
org.droidparts.dexmaker.dx.rop.code

public Interface TranslationAdvice

Known Direct Implementers
org.droidparts.dexmaker.dx.rop.code.ConservativeTranslationAdvice, org.droidparts.dexmaker.dx.rop.code.DexTranslationAdvice

Interface for "advice" passed from the late stage of translation back to the early stage. This allows for the final target architecture to exert its influence early in the translation process without having the early stage code be explicitly tied to the target.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

register count noted above
getMaxOptimalRegisterCount
()

Gets the maximum register width that can be represented optimally.

public boolean

Returns:

true iff the target can represent the operation using a constant for the last argument
hasConstantOperation
(Rop
non-null; the opcode
opcode
,
RegisterSpec
non-null; the first source
sourceA
,
RegisterSpec
non-null; the second source
sourceB
)

Returns an indication of whether the target can directly represent an instruction with the given opcode operating on the given arguments, where the last source argument is used as a constant.

public boolean

Returns:

true iff the target requires the sources to be in order and contiguous.
requiresSourcesInOrder
(Rop
non-null; opcode
opcode
,
RegisterSpecList
non-null; source list
sources
)

Returns true if the translation target requires the sources of the specified opcode to be in order and contiguous (eg, for an invoke-range)

Method Detail

getMaxOptimalRegisterCountback to summary
public int getMaxOptimalRegisterCount()

Gets the maximum register width that can be represented optimally. For example, Dex bytecode does not have instruction forms that take register numbers larger than 15 for all instructions so DexTranslationAdvice returns 15 here.

Returns:int

register count noted above

hasConstantOperationback to summary
public boolean hasConstantOperation(Rop opcode, RegisterSpec sourceA, RegisterSpec sourceB)

Returns an indication of whether the target can directly represent an instruction with the given opcode operating on the given arguments, where the last source argument is used as a constant. (That is, the last argument must have a type which indicates it is a known constant.) The instruction associated must have exactly two sources.

Parameters
opcode:Rop

non-null; the opcode

sourceA:RegisterSpec

non-null; the first source

sourceB:RegisterSpec

non-null; the second source

Returns:boolean

true iff the target can represent the operation using a constant for the last argument

requiresSourcesInOrderback to summary
public boolean requiresSourcesInOrder(Rop opcode, RegisterSpecList sources)

Returns true if the translation target requires the sources of the specified opcode to be in order and contiguous (eg, for an invoke-range)

Parameters
opcode:Rop

non-null; opcode

sources:RegisterSpecList

non-null; source list

Returns:boolean

true iff the target requires the sources to be in order and contiguous.