Class DexTranslationAdvice
java.lang.Object
com.android.dx.rop.code.DexTranslationAdvice
- All Implemented Interfaces:
TranslationAdvice
Implementation of
TranslationAdvice which represents what
the dex format will be able to represent.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DexTranslationAdvicedebug advice for disabling invoke-range optimizationstatic final DexTranslationAdvicenon-null;standard instance of this class -
Method Summary
Modifier and TypeMethodDescriptionintGets the maximum register width that can be represented optimally.booleanhasConstantOperation(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.booleanrequiresSourcesInOrder(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)
-
Field Details
-
THE_ONE
non-null;standard instance of this class -
NO_SOURCES_IN_ORDER
debug advice for disabling invoke-range optimization
-
-
Method Details
-
hasConstantOperation
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.- Specified by:
hasConstantOperationin interfaceTranslationAdvice- Parameters:
opcode-non-null;the opcodesourceA-non-null;the first sourcesourceB-non-null;the second source- Returns:
trueiff the target can represent the operation using a constant for the last argument
-
requiresSourcesInOrder
Returns true if the translation target requires the sources of the specified opcode to be in order and contiguous (eg, for an invoke-range)- Specified by:
requiresSourcesInOrderin interfaceTranslationAdvice- Parameters:
opcode-non-null;opcodesources-non-null;source list- Returns:
trueiff the target requires the sources to be in order and contiguous.
-
getMaxOptimalRegisterCount
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.- Specified by:
getMaxOptimalRegisterCountin interfaceTranslationAdvice- Returns:
- register count noted above
-