com.android.dx.dex.code.form
Class Form31c

java.lang.Object
  extended by com.android.dx.dex.code.InsnFormat
      extended by com.android.dx.dex.code.form.Form31c

public final class Form31c
extends InsnFormat

Instruction format 31c. See the instruction format spec for details.


Field Summary
static InsnFormat THE_ONE
          non-null; unique instance of this class
 
Fields inherited from class com.android.dx.dex.code.InsnFormat
ALLOW_EXTENDED_OPCODES
 
Method Summary
 int codeSize()
          Gets the code size of instructions that use this format.
 BitSet compatibleRegs(DalvInsn insn)
          Returns which of a given instruction's registers will fit in this instance's format.
 String insnArgString(DalvInsn insn)
          Returns the string form of the arguments to the given instruction.
 String 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, cstComment, cstString, isRegListSequential, listingString, literalBitsComment, literalBitsString, makeByte, opcodeUnit, opcodeUnit, regListString, regRangeString, signedFitsInByte, signedFitsInNibble, signedFitsInShort, unsignedFitsInByte, unsignedFitsInNibble, unsignedFitsInShort, write, write, write, write, write, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THE_ONE

public static final InsnFormat THE_ONE
non-null; unique instance of this class

Method Detail

insnArgString

public String insnArgString(DalvInsn insn)
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 "", not null.

Subclasses must override this method.

Specified by:
insnArgString in class InsnFormat
Parameters:
insn - non-null; the instruction
Returns:
non-null; the string form

insnCommentString

public String insnCommentString(DalvInsn insn,
                                boolean noteIndices)
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 "", not null.

Subclasses must override this method.

Specified by:
insnCommentString in class InsnFormat
Parameters:
insn - non-null; the instruction
noteIndices - 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 class InsnFormat
Returns:
>= 0; the instruction length in 16-bit code units

isCompatible

public boolean isCompatible(DalvInsn insn)
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 class InsnFormat
Parameters:
insn - non-null; the instruction to check
Returns:
true iff the instruction's arguments are appropriate for this instance, or false if not

compatibleRegs

public BitSet compatibleRegs(DalvInsn insn)
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 class InsnFormat
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

public void writeTo(AnnotatedOutput out,
                    DalvInsn insn)
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 class InsnFormat
Parameters:
out - non-null; the output destination to write to
insn - non-null; the instruction to write


Copyright © 2012. All Rights Reserved.