Top Description Fields Constructors Methods
org.droidparts.dexmaker.dx.dex.code

public final Class DalvInsnList

extends FixedSizeList
Class Inheritance
Imports
org.droidparts.dexmaker.dx.io.Opcodes, org.droidparts.dexmaker.dx.rop.cst.Constant, .CstBaseMethodRef, org.droidparts.dexmaker.dx.util.AnnotatedOutput, .ExceptionWithContext, .FixedSizeList, .IndentingWriter, java.io.IOException, .OutputStream, .OutputStreamWriter, .Writer, java.util.ArrayList

List of DalvInsn instances.

Field Summary

Modifier and TypeField and Description
private final int
regCount

The amount of register space, in register units, required for this code block.

Constructor Summary

AccessConstructor and Description
public
DalvInsnList(int
the size of the list
size
,
int regCount)

Constructs an instance.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

>= 0; the size
codeSize
()

Gets the size of this instance, in 16-bit code units.

public void
debugPrint(Writer
non-null; where to dump
out
,
String
non-null; prefix to attach to each line of output
prefix
,
boolean
whether to be verbose; verbose output includes lines for zero-size instructions and explicit constant pool indices
verbose
)

Does a human-friendly dump of this instance.

public void
debugPrint(OutputStream
non-null; where to dump
out
,
String
non-null; prefix to attach to each line of output
prefix
,
boolean
whether to be verbose; verbose output includes lines for zero-size instructions
verbose
)

Does a human-friendly dump of this instance.

public DalvInsn

Returns:

non-null; element at that index
get
(int
>= 0, < size(); which index
n
)

Gets the element at the given index.

public int

Returns:

>= 0; the required outgoing arguments size
getOutsSize
()

Gets the size of the outgoing arguments area required by this method.

public int

Returns:

>= 0; the required registers size
getRegistersSize
()

Gets the minimum required register count implied by this instance.

public static DalvInsnList

Returns:

non-null; an appropriately-constructed instance of this class
makeImmutable
(ArrayList<DalvInsn>
non-null; the list to use for elements
list
,
int
count, in register-units, of the number of registers this code block requires.
regCount
)

Constructs and returns an immutable instance whose elements are identical to the ones in the given list, in the same order.

public void
set(int
>= 0, < size(); which index
n
,
DalvInsn
non-null; the instruction to set at n
insn
)

Sets the instruction at the given index.

public void
writeTo(AnnotatedOutput
non-null; where to write to
out
)

Writes all the instructions in this instance to the given output destination.

Inherited from org.droidparts.dexmaker.dx.util.FixedSizeList:
equalsget0getOrNull0hashCodeset0shrinkToFitsizetoHumantoHumantoStringtoString

Field Detail

regCountback to summary
private final int regCount

The amount of register space, in register units, required for this code block. This may be greater than the largest observed register+ category because the method this code block exists in may specify arguments that are unused by the method.

Constructor Detail

DalvInsnListback to summary
public DalvInsnList(int size, int regCount)

Constructs an instance. All indices initially contain null.

Parameters
size:int

the size of the list

Method Detail

codeSizeback to summary
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:int

>= 0; the size

debugPrintback to summary
public void debugPrint(Writer out, String prefix, boolean verbose)

Does a human-friendly dump of this instance.

Parameters
out:Writer

non-null; where to dump

prefix:String

non-null; prefix to attach to each line of output

verbose:boolean

whether to be verbose; verbose output includes lines for zero-size instructions and explicit constant pool indices

debugPrintback to summary
public void debugPrint(OutputStream out, String prefix, boolean verbose)

Does a human-friendly dump of this instance.

Parameters
out:OutputStream

non-null; where to dump

prefix:String

non-null; prefix to attach to each line of output

verbose:boolean

whether to be verbose; verbose output includes lines for zero-size instructions

getback to summary
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:int

>= 0, < size(); which index

Returns:DalvInsn

non-null; element at that index

getOutsSizeback to summary
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:int

>= 0; the required outgoing arguments size

getRegistersSizeback to summary
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:int

>= 0; the required registers size

makeImmutableback to summary
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:ArrayList<DalvInsn>

non-null; the list to use for elements

regCount:int

count, in register-units, of the number of registers this code block requires.

Returns:DalvInsnList

non-null; an appropriately-constructed instance of this class

setback to summary
public void set(int n, DalvInsn insn)

Sets the instruction at the given index.

Parameters
n:int

>= 0, < size(); which index

insn:DalvInsn

non-null; the instruction to set at n

writeToback to summary
public void writeTo(AnnotatedOutput out)

Writes all the instructions in this instance to the given output destination.

Parameters
out:AnnotatedOutput

non-null; where to write to