com.android.dx.dex.code
Class DalvInsnList

java.lang.Object
  extended by com.android.dx.util.MutabilityControl
      extended by com.android.dx.util.FixedSizeList
          extended by com.android.dx.dex.code.DalvInsnList
All Implemented Interfaces:
ToHuman

public final class DalvInsnList
extends FixedSizeList

List of DalvInsn instances.


Constructor Summary
DalvInsnList(int size, int regCount)
          Constructs an instance.
 
Method Summary
 int codeSize()
          Gets the size of this instance, in 16-bit code units.
 void debugPrint(OutputStream out, String prefix, boolean verbose)
          Does a human-friendly dump of this instance.
 void debugPrint(Writer out, String prefix, boolean verbose)
          Does a human-friendly dump of this instance.
 DalvInsn get(int n)
          Gets the element at the given index.
 int getOutsSize()
          Gets the size of the outgoing arguments area required by this method.
 int getRegistersSize()
          Gets the minimum required register count implied by this instance.
static DalvInsnList makeImmutable(ArrayList<DalvInsn> list, int regCount)
          Constructs and returns an immutable instance whose elements are identical to the ones in the given list, in the same order.
 void set(int n, DalvInsn insn)
          Sets the instruction at the given index.
 void writeTo(AnnotatedOutput out)
          Writes all the instructions in this instance to the given output destination.
 
Methods inherited from class com.android.dx.util.FixedSizeList
equals, get0, getOrNull0, hashCode, set0, shrinkToFit, size, toHuman, toHuman, toString, toString
 
Methods inherited from class com.android.dx.util.MutabilityControl
isImmutable, isMutable, setImmutable, throwIfImmutable, throwIfMutable
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DalvInsnList

public DalvInsnList(int size,
                    int regCount)
Constructs an instance. All indices initially contain null.

Parameters:
size - the size of the list
Method Detail

makeImmutable

public static DalvInsnList makeImmutable(ArrayList<DalvInsn> list,
                                         int regCount)
Constructs and returns an immutable instance whose elements are identical to the ones in the given list, in the same order.

Parameters:
list - non-null; the list to use for elements
regCount - count, in register-units, of the number of registers this code block requires.
Returns:
non-null; an appropriately-constructed instance of this class

get

public DalvInsn get(int n)
Gets the element at the given index. It is an error to call this with the index for an element which was never set; if you do that, this will throw NullPointerException.

Parameters:
n - >= 0, < size(); which index
Returns:
non-null; element at that index

set

public void set(int n,
                DalvInsn insn)
Sets the instruction at the given index.

Parameters:
n - >= 0, < size(); which index
insn - non-null; the instruction to set at n

codeSize

public int codeSize()
Gets the size of this instance, in 16-bit code units. This will only return a meaningful result if the instructions in this instance all have valid addresses.

Returns:
>= 0; the size

writeTo

public void writeTo(AnnotatedOutput out)
Writes all the instructions in this instance to the given output destination.

Parameters:
out - non-null; where to write to

getRegistersSize

public int getRegistersSize()
Gets the minimum required register count implied by this instance. This includes any unused parameters that could potentially be at the top of the register space.

Returns:
>= 0; the required registers size

getOutsSize

public int getOutsSize()
Gets the size of the outgoing arguments area required by this method. This is equal to the largest argument word count of any method referred to by this instance.

Returns:
>= 0; the required outgoing arguments size

debugPrint

public void debugPrint(Writer out,
                       String prefix,
                       boolean verbose)
Does a human-friendly dump of this instance.

Parameters:
out - non-null; where to dump
prefix - non-null; prefix to attach to each line of output
verbose - whether to be verbose; verbose output includes lines for zero-size instructions and explicit constant pool indices

debugPrint

public void debugPrint(OutputStream out,
                       String prefix,
                       boolean verbose)
Does a human-friendly dump of this instance.

Parameters:
out - non-null; where to dump
prefix - non-null; prefix to attach to each line of output
verbose - whether to be verbose; verbose output includes lines for zero-size instructions


Copyright © 2012. All Rights Reserved.