Class Form11x
java.lang.Object
com.android.dx.dex.code.InsnFormat
com.android.dx.dex.code.form.Form11x
Instruction format
11x. See the instruction format spec
for details.-
Field Summary
FieldsFields inherited from class InsnFormat
ALLOW_EXTENDED_OPCODES -
Method Summary
Modifier and TypeMethodDescriptionintcodeSize()Gets the code size of instructions that use this format.compatibleRegs(DalvInsn insn) Returns which of a given instruction's registers will fit in this instance's format.insnArgString(DalvInsn insn) Returns the string form of the arguments to the given instruction.insnCommentString(DalvInsn insn, boolean noteIndices) Returns the associated comment for the given instruction, if any.booleanisCompatible(DalvInsn insn) Returns whether or not the given instruction's arguments will fit in this instance's format.voidwriteTo(AnnotatedOutput out, DalvInsn insn) Writes the code units for the given instruction to the given output destination.Methods inherited from class InsnFormat
argIndex, branchComment, branchFits, branchString, codeUnit, codeUnit, isRegListSequential, listingString, literalBitsComment, literalBitsString, makeByte, opcodeUnit, opcodeUnit, regListString, regRangeString, signedFitsInByte, signedFitsInNibble, signedFitsInShort, unsignedFitsInByte, unsignedFitsInNibble, unsignedFitsInShort, write, write, write, write, write, write, write, write, write
-
Field Details
-
THE_ONE
non-null;unique instance of this class
-
-
Method Details
-
insnArgString
Returns the string form of the arguments to the given instruction. The instruction must be of this instance's format. If the instruction has no arguments, then the result should be"", notnull.Subclasses must override this method.
- Specified by:
insnArgStringin classInsnFormat- Parameters:
insn-non-null;the instruction- Returns:
non-null;the string form
-
insnCommentString
Returns the associated comment for the given instruction, if any. The instruction must be of this instance's format. If the instruction has no comment, then the result should be"", notnull.Subclasses must override this method.
- Specified by:
insnCommentStringin classInsnFormat- Parameters:
insn-non-null;the instructionnoteIndices- whether to include an explicit notation of constant pool indices- Returns:
non-null;the string form
-
codeSize
public int codeSize()Gets the code size of instructions that use this format. The size is a number of 16-bit code units, not bytes. This should throw an exception if this format is of variable size.- Specified by:
codeSizein classInsnFormat- Returns:
>= 0;the instruction length in 16-bit code units
-
isCompatible
Returns whether or not the given instruction's arguments will fit in this instance's format. This includes such things as counting register arguments, checking register ranges, and making sure that additional arguments are of appropriate types and are in-range. If this format has a branch target but the instruction's branch offset is unknown, this method will simply not check the offset.Subclasses must override this method.
- Specified by:
isCompatiblein classInsnFormat- Parameters:
insn-non-null;the instruction to check- Returns:
trueiff the instruction's arguments are appropriate for this instance, orfalseif not
-
compatibleRegs
Returns which of a given instruction's registers will fit in this instance's format.The default implementation of this method always returns an empty BitSet. Subclasses must override this method if they have registers.
- Overrides:
compatibleRegsin classInsnFormat- Parameters:
insn-non-null;the instruction to check- Returns:
non-null;a BitSet flagging registers in the register list that are compatible to this format
-
writeTo
Writes the code units for the given instruction to the given output destination. The instruction must be of this instance's format.Subclasses must override this method.
- Specified by:
writeToin classInsnFormat- Parameters:
out-non-null;the output destination to write toinsn-non-null;the instruction to write
-