FileDocCategorySizeDatePackage
TranslationAdvice.javaAPI DocAndroid 1.5 API2558Wed May 06 22:41:02 BST 2009com.android.dx.rop.code

TranslationAdvice

public interface TranslationAdvice
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.

Fields Summary
Constructors Summary
Methods Summary
public intgetMaxOptimalRegisterCount()
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.

return
register count noted above

public 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. (That is, the last argument must have a type which indicates it is a known constant.) The instruction associated must have exactly two sources.

param
opcode non-null; the opcode
param
sourceA non-null; the first source
param
sourceB non-null; the second source
return
true iff the target can represent the operation using a constant for the last argument

public 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)

param
opcode non-null; opcode
param
sources non-null; source list
return
true iff the target requires the sources to be in order and contiguous.