com.android.dx.dex.code
Class FixedSizeInsn

java.lang.Object
  extended by com.android.dx.dex.code.DalvInsn
      extended by com.android.dx.dex.code.FixedSizeInsn
Direct Known Subclasses:
CstInsn, SimpleInsn, TargetInsn

public abstract class FixedSizeInsn
extends DalvInsn

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
FixedSizeInsn(Dop opcode, SourcePosition position, RegisterSpecList registers)
          Constructs an instance.
 
Method Summary
 int codeSize()
          Gets the size of this instruction, in 16-bit code units.
protected  String listingString0(boolean noteIndices)
          Helper for DalvInsn.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.
 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.
 void writeTo(AnnotatedOutput out)
          Writes this instance to the given output.
 
Methods inherited from class com.android.dx.dex.code.DalvInsn
argString, expandedPrefix, expandedSuffix, expandedVersion, getAddress, getLowRegVersion, getMinimumRegisterRequirement, getNextAddress, getOpcode, getPosition, getRegisters, hasAddress, hasResult, identifierString, listingString, makeMove, setAddress, toString, withOpcode, withRegisters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FixedSizeInsn

public FixedSizeInsn(Dop opcode,
                     SourcePosition position,
                     RegisterSpecList registers)
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 as RegisterSpecList.EMPTY.

Parameters:
opcode - the opcode; one of the constants from Dops
position - non-null; source position
registers - non-null; register list, including a result register if appropriate (that is, registers may be either ins or outs)
Method Detail

codeSize

public final int codeSize()
Gets the size of this instruction, in 16-bit code units.

Specified by:
codeSize in class DalvInsn
Returns:
>= 0; the code size of this instruction

writeTo

public final void writeTo(AnnotatedOutput out)
Writes this instance to the given output. This method should never annotate the output.

Specified by:
writeTo in class DalvInsn
Parameters:
out - non-null; where to write to

withRegisterOffset

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

Specified by:
withRegisterOffset in class DalvInsn
Parameters:
delta - the amount to offset register references by
Returns:
non-null; an appropriately-constructed instance

listingString0

protected final String listingString0(boolean noteIndices)
Helper for DalvInsn.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 return null if this instance should not appear in a listing.

Specified by:
listingString0 in class DalvInsn
Parameters:
noteIndices - whether to include an explicit notation of constant pool indices
Returns:
null-ok; the listing string


Copyright © 2012. All Rights Reserved.