Class DalvInsnList
java.lang.Object
com.android.dx.util.MutabilityControl
com.android.dx.util.FixedSizeList
com.android.dx.dex.code.DalvInsnList
- All Implemented Interfaces:
ToHuman
List of
DalvInsn instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcodeSize()Gets the size of this instance, in 16-bit code units.voiddebugPrint(OutputStream out, String prefix, boolean verbose) Does a human-friendly dump of this instance.voiddebugPrint(Writer out, String prefix, boolean verbose) Does a human-friendly dump of this instance.get(int n) Gets the element at the given index.intGets the size of the outgoing arguments area required by this method.intGets the minimum required register count implied by this instance.static DalvInsnListmakeImmutable(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.voidSets the instruction at the given index.voidwriteTo(AnnotatedOutput out) Writes all the instructions in this instance to the given output destination.Methods inherited from class FixedSizeList
equals, get0, getOrNull0, hashCode, set0, shrinkToFit, size, toHuman, toHuman, toString, toStringMethods inherited from class MutabilityControl
isImmutable, isMutable, setImmutable, throwIfImmutable, throwIfMutable
-
Constructor Details
-
DalvInsnList
public DalvInsnList(int size, int regCount) Constructs an instance. All indices initially containnull.- Parameters:
size- the size of the listregCount- count, in register-units, of the number of registers this code block requires.
-
-
Method Details
-
makeImmutable
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 elementsregCount- count, in register-units, of the number of registers this code block requires.- Returns:
non-null;an appropriately-constructed instance of this class
-
get
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 throwNullPointerException.- Parameters:
n->= 0, < size();which index- Returns:
non-null;element at that index
-
set
Sets the instruction at the given index.- Parameters:
n->= 0, < size();which indexinsn-non-null;the instruction to set atn
-
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
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
Does a human-friendly dump of this instance.- Parameters:
out-non-null;where to dumpprefix-non-null;prefix to attach to each line of outputverbose- whether to be verbose; verbose output includes lines for zero-size instructions and explicit constant pool indices
-
debugPrint
Does a human-friendly dump of this instance.- Parameters:
out-non-null;where to dumpprefix-non-null;prefix to attach to each line of outputverbose- whether to be verbose; verbose output includes lines for zero-size instructions
-