|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.uka.ipd.sdq.ByCounter.parsing.InstructionBlockDescriptor
de.uka.ipd.sdq.ByCounter.parsing.RangeBlockDescriptor
public class RangeBlockDescriptor
Descriptor for range blocks, i.e. sections of code in methods defined in
LineNumberRange
s using
MethodDescriptor.setCodeAreasToInstrument(LineNumberRange[])
.
The descriptor describes the basic blocks of which the range block is made up.
If a range block starts or ends in the middle of a basic block, the
InstructionBlockDescriptor
s in getBasicBlockOffsets()
describe the difference in counts.
Results are calculated using the following algorithm (pseudo code):
for each basic block b with instructions counts b.counts and execution count b.c: result += b.c*b.counts for each basicBlockOffset bbOffset for basicBlock offsetBB: result -= bbOffset*offsetBB.c
Nested Class Summary | |
---|---|
class |
RangeBlockDescriptor.BasicBlockOffset
Describes which instructions in the basic block with the index RangeBlockDescriptor.BasicBlockOffset.basicBlockIndex are added/subtracted in addition to normal
basic block counts. |
Constructor Summary | |
---|---|
RangeBlockDescriptor(int numOfBasicBlocks)
Construct a new RangeBlockDescriptor . |
Method Summary | |
---|---|
void |
add(InstructionBlockDescriptor instructionBlockDescriptor)
Adds instruction counts of the given block to this block. |
int[] |
getBasicBlockCounts()
|
java.util.List<java.lang.Integer> |
getBasicBlockIndexesWithOffsets()
|
java.util.List<RangeBlockDescriptor.BasicBlockOffset> |
getBasicBlockOffsets()
|
java.util.Map<java.lang.String,java.lang.Integer> |
getMethodCallCounts()
For RangeBlockDescriptor , this is unused. |
int[] |
getOpcodeCounts()
For RangeBlockDescriptor , this is unused. |
static void |
setUsesBasicBlock(RangeBlockDescriptor rangeBlockDescriptor,
int basicBlockIndex)
Sets the counter for the specified basic block to 1. |
java.lang.String |
toString()
|
Methods inherited from class de.uka.ipd.sdq.ByCounter.parsing.InstructionBlockDescriptor |
---|
addInstruction, getBlockIndex, isEmpty, setBlockIndex, subtract |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RangeBlockDescriptor(int numOfBasicBlocks)
RangeBlockDescriptor
.
numOfBasicBlocks
- The number of basic blocks in the method; used
for indexing basic block counts in the range block.Method Detail |
---|
public java.util.Map<java.lang.String,java.lang.Integer> getMethodCallCounts()
RangeBlockDescriptor
, this is unused.
getMethodCallCounts
in class InstructionBlockDescriptor
public int[] getOpcodeCounts()
RangeBlockDescriptor
, this is unused.
getOpcodeCounts
in class InstructionBlockDescriptor
public void add(InstructionBlockDescriptor instructionBlockDescriptor)
InstructionBlockDescriptor
add
in class InstructionBlockDescriptor
public int[] getBasicBlockCounts()
public static void setUsesBasicBlock(RangeBlockDescriptor rangeBlockDescriptor, int basicBlockIndex)
rangeBlockDescriptor
- The RangeBlockDescriptor
to modify.basicBlockIndex
- Index of the basic block that has to be
counted in this rangeBlock.public java.util.List<RangeBlockDescriptor.BasicBlockOffset> getBasicBlockOffsets()
public java.util.List<java.lang.Integer> getBasicBlockIndexesWithOffsets()
getBasicBlockOffsets()
public java.lang.String toString()
toString
in class InstructionBlockDescriptor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |