Package com.android.dx.dex.code.form
Class Form11n
java.lang.Object
com.android.dx.dex.code.InsnFormat
com.android.dx.dex.code.form.Form11n
Instruction format
11n
. See the instruction format spec
for details.-
Field Summary
Fields inherited from class com.android.dx.dex.code.InsnFormat
ALLOW_EXTENDED_OPCODES
-
Method Summary
Modifier and TypeMethodDescriptionint
codeSize()
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.boolean
isCompatible
(DalvInsn insn) Returns whether or not the given instruction's arguments will fit in this instance's format.void
writeTo
(AnnotatedOutput out, DalvInsn insn) Writes the code units for the given instruction to the given output destination.Methods inherited from class com.android.dx.dex.code.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:
insnArgString
in 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:
insnCommentString
in 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:
codeSize
in 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:
isCompatible
in classInsnFormat
- Parameters:
insn
-non-null;
the instruction to check- Returns:
true
iff the instruction's arguments are appropriate for this instance, orfalse
if 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:
compatibleRegs
in 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:
writeTo
in classInsnFormat
- Parameters:
out
-non-null;
the output destination to write toinsn
-non-null;
the instruction to write
-