public class BBlock extends Object
Constructor | Description |
---|---|
BBlock(CFG cfg,
org.objectweb.asm.Label start,
int blockIdx) |
construct a new basic block
|
Modifier and Type | Method | Description |
---|---|---|
void |
addHandlerStarts(List<TryCatchDetails> details) |
record details of a try catch block handler which starts in this block
|
void |
addTryEnds(List<TryCatchDetails> details) |
record details of a try catch block which ends in this block
|
void |
addTryStarts(List<TryCatchDetails> details) |
record details of a try catch block which starts in this block
|
int |
append(int instruction) |
add an instruction to the sequence in the block
|
int |
append(int instruction,
int operand) |
add an instruction with one int operand to thhe sequence in the block
|
int |
append(int instruction,
int[] operands) |
add an instruction with an arbitrary number of int operands to thhe sequence in the block
|
int |
append(int instruction,
int operand1,
int operand2) |
add an instruction with two int operands to the sequence in the block
|
int |
append(int instruction,
int operand1,
int operand2,
int operand3) |
add an instruction with three int operands to thhe sequence in the block
|
int |
append(int instruction,
int operand1,
int operand2,
int operand3,
int operand4) |
add an instruction with four int operands to the sequence in the block
|
void |
append(org.objectweb.asm.Label label) |
install an outgoing normal control flow link
|
org.objectweb.asm.Label |
firstOut() |
return the label of the first normal control flow link
|
List<TryCatchDetails> |
getActiveTryStarts() |
retrieve details of all try catch blocks which are capable of generating an exception in this block
|
int |
getBlockIdx() |
retrieve the index of this block in the block sequence.
|
CFG |
getCFG() |
obtain the control flow graph to which this block belongs
|
Iterator<TryCatchDetails> |
getHandlerStarts() |
retrieve details of all try catch block handlers whcih start in this block
|
int |
getInstruction(int index) |
return the instruction at a given index.
|
int |
getInstructionArg(int index,
int argIndex) |
retrieve the integer operand or encoded name associated with a particular instruction
|
int |
getInstructionCount() |
return the number of instructions in the blocks instructuion sequence equivalent to the
index of the next instruction added to the block.
|
org.objectweb.asm.Label |
getLabel() |
get the primary label which idenitfies this block.
|
int |
getMonitorEnterCount() |
retrieve a count of all monitor enter instruction locations occurring in this block
|
Iterator<CodeLocation> |
getMonitorEnters() |
retrieve a list of all monitor enter instruction locations occurring in this block
|
int |
getMonitorExitCount() |
retrieve a count of all monitor exit instruction locations occuring in this block
|
Iterator<CodeLocation> |
getMonitorExits() |
retrieve a list of all monitor exit instruction locations occurring in this block
|
Iterator<TryCatchDetails> |
getTryEnds() |
retrieve details of all try catch blocks which end in this block
|
org.objectweb.asm.Label |
next() |
return the label of the next block in line in the block sequence in bytecode order.
|
int |
nOuts() |
return a count of the normal control flow links from this block.
|
org.objectweb.asm.Label |
nthOut(int n) |
return the label of the nth normal control flow link
|
void |
printLabelOffset(StringBuffer buf,
org.objectweb.asm.Label l,
boolean appendBlockPos,
Object altText) |
|
org.objectweb.asm.Label |
secondOut() |
return the label of the second normal control flow link
|
void |
setActiveTryStarts(List<TryCatchDetails> active) |
set the list of try starts which are active somewhere in this block.
|
String |
toString() |
return a string representation of this block
|
public BBlock(CFG cfg, org.objectweb.asm.Label start, int blockIdx)
cfg
- the control flow graph it belongs tostart
- the label for the start of the blockblockIdx
- the index of the block which respects the order of the bytecode segments
contained in each block.public CFG getCFG()
public org.objectweb.asm.Label getLabel()
public int getBlockIdx()
public int append(int instruction)
instruction
- an Opcodepublic int append(int instruction, int operand)
instruction
- an Opcodeoperand
- an int operand or the code for a String operand lcoated in the cfg name tablepublic int append(int instruction, int operand1, int operand2)
instruction
- an Opcodeoperand1
- an int operand or the code for a String operand lcoated in the cfg name tableoperand2
- an int operand or the code for a String operand lcoated in the cfg name tablepublic int append(int instruction, int operand1, int operand2, int operand3)
instruction
- an Opcodeoperand1
- an int operand or the code for a String operand lcoated in the cfg name tableoperand2
- an int operand or the code for a String operand lcoated in the cfg name tableoperand3
- an int operand or the code for a String operand lcoated in the cfg name tablepublic int append(int instruction, int operand1, int operand2, int operand3, int operand4)
instruction
- an Opcodeoperand1
- an int operand or the code for a String operand lcoated in the cfg name tableoperand2
- an int operand or the code for a String operand lcoated in the cfg name tableoperand3
- an int operand or the code for a String operand lcoated in the cfg name tableoperand4
- an int operand or the code for a String operand lcoated in the cfg name tablepublic int append(int instruction, int[] operands)
instruction
- an Opcodeoperands
- an array containing int operands or codes for String operands lcoated in the cfg name tablepublic void addTryStarts(List<TryCatchDetails> details)
details
- list of try catch block detailspublic void addTryEnds(List<TryCatchDetails> details)
details
- list of try catch block detailspublic void addHandlerStarts(List<TryCatchDetails> details)
details
- list of try catch block detailspublic void setActiveTryStarts(List<TryCatchDetails> active)
active
- list of active try catch block detailspublic Iterator<TryCatchDetails> getTryEnds()
public Iterator<TryCatchDetails> getHandlerStarts()
public List<TryCatchDetails> getActiveTryStarts()
public Iterator<CodeLocation> getMonitorEnters()
public Iterator<CodeLocation> getMonitorExits()
public int getMonitorEnterCount()
public int getMonitorExitCount()
public int getInstructionCount()
public int getInstruction(int index)
index
- the index for the instructionpublic int getInstructionArg(int index, int argIndex)
index
- the index of the instruction in the blockargIndex
- the index of the argument in the sequence of arguments presented when the instruction
was inserted into the block.public void append(org.objectweb.asm.Label label)
label
- the control flow destinationpublic org.objectweb.asm.Label next()
public org.objectweb.asm.Label firstOut()
public org.objectweb.asm.Label secondOut()
public org.objectweb.asm.Label nthOut(int n)
n
- the index of the linkpublic int nOuts()
public String toString()
public void printLabelOffset(StringBuffer buf, org.objectweb.asm.Label l, boolean appendBlockPos, Object altText)
Copyright © 2018. All rights reserved.