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

public final Class RopMethod

extends Object
Class Inheritance
Imports
org.droidparts.dexmaker.dx.util.Hex, .IntList

All of the parts that make up a method at the rop layer.

Field Summary

Modifier and TypeField and Description
private final BasicBlockList
blocks

non-null; basic block list of the method

private IntList
exitPredecessors

null-ok; the predecessors for the implicit "exit" block, that is the labels for the blocks that return, if calculated

private final int
firstLabel

>= 0; label for the block which starts the method

private IntList[]
predecessors

null-ok; array of predecessors for each block, indexed by block label

Constructor Summary

AccessConstructor and Description
public
RopMethod(BasicBlockList
non-null; basic block list of the method
blocks
,
int
>= 0; the label of the first block to execute
firstLabel
)

Constructs an instance.

Method Summary

Modifier and TypeMethod and Description
private void
calcPredecessors()

Calculates the predecessor sets for each block as well as for the exit.

public BasicBlockList

Returns:

non-null; the list
getBlocks
()

Gets the basic block list for this method.

public IntList

Returns:

non-null; the exit predecessors
getExitPredecessors
()

Gets the exit predecessors for this instance.

public int

Returns:

>= 0; the first-block label
getFirstLabel
()

Gets the label for the first block in the method that this list represents.

public IntList

Returns:

non-null; the predecessors of that block
labelToPredecessors
(int
>= 0; the label of the block in question
label
)

Gets the predecessors associated with the given block.

public RopMethod

Returns:

non-null; an appropriately-constructed instance
withRegisterOffset
(int
the amount to offset register numbers by
delta
)

Returns an instance that is identical to this one, except that the registers in each instruction are offset by the given amount.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

blocksback to summary
private final BasicBlockList blocks

non-null; basic block list of the method

exitPredecessorsback to summary
private IntList exitPredecessors

null-ok; the predecessors for the implicit "exit" block, that is the labels for the blocks that return, if calculated

firstLabelback to summary
private final int firstLabel

>= 0; label for the block which starts the method

predecessorsback to summary
private IntList[] predecessors

null-ok; array of predecessors for each block, indexed by block label

Constructor Detail

RopMethodback to summary
public RopMethod(BasicBlockList blocks, int firstLabel)

Constructs an instance.

Parameters
blocks:BasicBlockList

non-null; basic block list of the method

firstLabel:int

>= 0; the label of the first block to execute

Method Detail

calcPredecessorsback to summary
private void calcPredecessors()

Calculates the predecessor sets for each block as well as for the exit.

getBlocksback to summary
public BasicBlockList getBlocks()

Gets the basic block list for this method.

Returns:BasicBlockList

non-null; the list

getExitPredecessorsback to summary
public IntList getExitPredecessors()

Gets the exit predecessors for this instance.

Returns:IntList

non-null; the exit predecessors

getFirstLabelback to summary
public int getFirstLabel()

Gets the label for the first block in the method that this list represents.

Returns:int

>= 0; the first-block label

labelToPredecessorsback to summary
public IntList labelToPredecessors(int label)

Gets the predecessors associated with the given block. This throws an exception if there is no block with the given label.

Parameters
label:int

>= 0; the label of the block in question

Returns:IntList

non-null; the predecessors of that block

withRegisterOffsetback to summary
public RopMethod withRegisterOffset(int delta)

Returns an instance that is identical to this one, except that the registers in each instruction are offset by the given amount.

Parameters
delta:int

the amount to offset register numbers by

Returns:RopMethod

non-null; an appropriately-constructed instance