Package com.android.dx.dex.code
Class FixedSizeInsn
java.lang.Object
com.android.dx.dex.code.DalvInsn
com.android.dx.dex.code.FixedSizeInsn
- Direct Known Subclasses:
CstInsn
,MultiCstInsn
,SimpleInsn
,TargetInsn
Base class for instructions which are of a fixed code size and
which use
InsnFormat
methods to write themselves. This
includes most — but not all — instructions.-
Constructor Summary
ConstructorDescriptionFixedSizeInsn
(Dop opcode, SourcePosition position, RegisterSpecList registers) Constructs an instance. -
Method Summary
Modifier and TypeMethodDescriptionfinal int
codeSize()
Gets the size of this instruction, in 16-bit code units.protected final String
listingString0
(boolean noteIndices) Helper forDalvInsn.listingString(java.lang.String, int, boolean)
, which returns the string form of this instance suitable for inclusion in a human-oriented listing dump, not including the instruction address and without respect for any output formatting.final DalvInsn
withRegisterOffset
(int delta) Returns an instance that is just like this one, except that all register references have been offset by the given delta, and its address is reset.final void
writeTo
(AnnotatedOutput out) Writes this instance to the given output.Methods inherited from class com.android.dx.dex.code.DalvInsn
argString, cstComment, cstString, expandedPrefix, expandedSuffix, expandedVersion, getAddress, getLowRegVersion, getMinimumRegisterRequirement, getNextAddress, getOpcode, getPosition, getRegisters, hasAddress, hasResult, identifierString, listingString, makeMove, setAddress, toString, withMapper, withOpcode, withRegisters
-
Constructor Details
-
FixedSizeInsn
Constructs an instance. The output address of this instance is initially unknown (-1
).Note: In the unlikely event that an instruction takes absolutely no registers (e.g., a
nop
or a no-argument no-result * static method call), then the given register list may be passed asRegisterSpecList.EMPTY
.- Parameters:
opcode
- the opcode; one of the constants fromDops
position
-non-null;
source positionregisters
-non-null;
register list, including a result register if appropriate (that is, registers may be either ins or outs)
-
-
Method Details
-
codeSize
public final int codeSize()Gets the size of this instruction, in 16-bit code units. -
writeTo
Writes this instance to the given output. This method should never annotate the output. -
withRegisterOffset
Returns an instance that is just like this one, except that all register references have been offset by the given delta, and its address is reset.- Specified by:
withRegisterOffset
in classDalvInsn
- Parameters:
delta
- the amount to offset register references by- Returns:
non-null;
an appropriately-constructed instance
-
listingString0
Helper forDalvInsn.listingString(java.lang.String, int, boolean)
, which returns the string form of this instance suitable for inclusion in a human-oriented listing dump, not including the instruction address and without respect for any output formatting. This method should returnnull
if this instance should not appear in a listing.- Specified by:
listingString0
in classDalvInsn
- Parameters:
noteIndices
- whether to include an explicit notation of constant pool indices- Returns:
null-ok;
the listing string
-