|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.objectweb.asm.MethodVisitor
org.jacoco.core.internal.flow.MethodProbesVisitor
org.jacoco.core.internal.analysis.MethodAnalyzer
public class MethodAnalyzer
A MethodProbesVisitor that analyzes which statements and branches of
a method has been executed based on given probe data.
| Field Summary |
|---|
| Fields inherited from class org.objectweb.asm.MethodVisitor |
|---|
api, mv |
| Constructor Summary | |
|---|---|
MethodAnalyzer(String name,
String desc,
String signature,
boolean[] probes)
New Method analyzer for the given probe data. |
|
| Method Summary | |
|---|---|
IMethodCoverage |
getCoverage()
Returns the coverage data for this method after this visitor has been processed. |
void |
visitEnd()
|
void |
visitFieldInsn(int opcode,
String owner,
String name,
String desc)
|
void |
visitIincInsn(int var,
int increment)
|
void |
visitInsn(int opcode)
|
void |
visitInsnWithProbe(int opcode,
int probeId)
Visits a zero operand instruction with a probe. |
void |
visitIntInsn(int opcode,
int operand)
|
void |
visitInvokeDynamicInsn(String name,
String desc,
org.objectweb.asm.Handle bsm,
Object... bsmArgs)
|
void |
visitJumpInsn(int opcode,
org.objectweb.asm.Label label)
|
void |
visitJumpInsnWithProbe(int opcode,
org.objectweb.asm.Label label,
int probeId)
Visits a jump instruction. |
void |
visitLabel(org.objectweb.asm.Label label)
|
void |
visitLdcInsn(Object cst)
|
void |
visitLineNumber(int line,
org.objectweb.asm.Label start)
|
void |
visitLookupSwitchInsn(org.objectweb.asm.Label dflt,
int[] keys,
org.objectweb.asm.Label[] labels)
|
void |
visitLookupSwitchInsnWithProbes(org.objectweb.asm.Label dflt,
int[] keys,
org.objectweb.asm.Label[] labels)
Visits a LOOKUPSWITCH instruction with optional probes for each target label. |
void |
visitMethodInsn(int opcode,
String owner,
String name,
String desc)
|
void |
visitMultiANewArrayInsn(String desc,
int dims)
|
void |
visitProbe(int probeId)
Visits an unconditional probe that should be inserted at the current position. |
void |
visitTableSwitchInsn(int min,
int max,
org.objectweb.asm.Label dflt,
org.objectweb.asm.Label... labels)
|
void |
visitTableSwitchInsnWithProbes(int min,
int max,
org.objectweb.asm.Label dflt,
org.objectweb.asm.Label[] labels)
Visits a TABLESWITCH instruction with optional probes for each target label. |
void |
visitTypeInsn(int opcode,
String type)
|
void |
visitVarInsn(int opcode,
int var)
|
| Methods inherited from class org.objectweb.asm.MethodVisitor |
|---|
visitAnnotation, visitAnnotationDefault, visitAttribute, visitCode, visitFrame, visitLocalVariable, visitMaxs, visitParameterAnnotation, visitTryCatchBlock |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MethodAnalyzer(String name,
String desc,
String signature,
boolean[] probes)
name - method namedesc - description of the methodsignature - optional parameterized signatureprobes - recorded probe date of the containing class or
null if the class is not executed at all| Method Detail |
|---|
public IMethodCoverage getCoverage()
public void visitLabel(org.objectweb.asm.Label label)
visitLabel in class org.objectweb.asm.MethodVisitor
public void visitLineNumber(int line,
org.objectweb.asm.Label start)
visitLineNumber in class org.objectweb.asm.MethodVisitorpublic void visitInsn(int opcode)
visitInsn in class org.objectweb.asm.MethodVisitor
public void visitIntInsn(int opcode,
int operand)
visitIntInsn in class org.objectweb.asm.MethodVisitor
public void visitVarInsn(int opcode,
int var)
visitVarInsn in class org.objectweb.asm.MethodVisitor
public void visitTypeInsn(int opcode,
String type)
visitTypeInsn in class org.objectweb.asm.MethodVisitor
public void visitFieldInsn(int opcode,
String owner,
String name,
String desc)
visitFieldInsn in class org.objectweb.asm.MethodVisitor
public void visitMethodInsn(int opcode,
String owner,
String name,
String desc)
visitMethodInsn in class org.objectweb.asm.MethodVisitor
public void visitInvokeDynamicInsn(String name,
String desc,
org.objectweb.asm.Handle bsm,
Object... bsmArgs)
visitInvokeDynamicInsn in class org.objectweb.asm.MethodVisitor
public void visitJumpInsn(int opcode,
org.objectweb.asm.Label label)
visitJumpInsn in class org.objectweb.asm.MethodVisitorpublic void visitLdcInsn(Object cst)
visitLdcInsn in class org.objectweb.asm.MethodVisitor
public void visitIincInsn(int var,
int increment)
visitIincInsn in class org.objectweb.asm.MethodVisitor
public void visitTableSwitchInsn(int min,
int max,
org.objectweb.asm.Label dflt,
org.objectweb.asm.Label... labels)
visitTableSwitchInsn in class org.objectweb.asm.MethodVisitor
public void visitLookupSwitchInsn(org.objectweb.asm.Label dflt,
int[] keys,
org.objectweb.asm.Label[] labels)
visitLookupSwitchInsn in class org.objectweb.asm.MethodVisitor
public void visitMultiANewArrayInsn(String desc,
int dims)
visitMultiANewArrayInsn in class org.objectweb.asm.MethodVisitorpublic void visitProbe(int probeId)
MethodProbesVisitor
visitProbe in class MethodProbesVisitorprobeId - id of the probe to insert
public void visitJumpInsnWithProbe(int opcode,
org.objectweb.asm.Label label,
int probeId)
MethodProbesVisitor
visitJumpInsnWithProbe in class MethodProbesVisitoropcode - the opcode of the type instruction to be visited. This opcode
is either IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ,
IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE,
IF_ACMPEQ, IF_ACMPNE, GOTO, IFNULL or IFNONNULL.label - the operand of the instruction to be visited. This operand is
a label that designates the instruction to which the jump
instruction may jump.probeId - id of the probeMethodVisitor.visitJumpInsn(int, Label)
public void visitInsnWithProbe(int opcode,
int probeId)
MethodProbesVisitor
visitInsnWithProbe in class MethodProbesVisitoropcode - the opcode of the instruction to be visited. This opcode is
either IRETURN, LRETURN, FRETURN, DRETURN, ARETURN, RETURN or
ATHROW.probeId - id of the probeMethodVisitor.visitInsn(int)
public void visitTableSwitchInsnWithProbes(int min,
int max,
org.objectweb.asm.Label dflt,
org.objectweb.asm.Label[] labels)
MethodProbesVisitorLabelInfo.getProbeId(Label).
visitTableSwitchInsnWithProbes in class MethodProbesVisitormin - the minimum key value.max - the maximum key value.dflt - beginning of the default handler block.labels - beginnings of the handler blocks. labels[i] is
the beginning of the handler block for the
min + i key.MethodVisitor.visitTableSwitchInsn(int, int, Label, Label[])
public void visitLookupSwitchInsnWithProbes(org.objectweb.asm.Label dflt,
int[] keys,
org.objectweb.asm.Label[] labels)
MethodProbesVisitorLabelInfo.getProbeId(Label).
visitLookupSwitchInsnWithProbes in class MethodProbesVisitordflt - beginning of the default handler block.keys - the values of the keys.labels - beginnings of the handler blocks. labels[i] is
the beginning of the handler block for the
keys[i] key.MethodVisitor.visitLookupSwitchInsn(Label, int[], Label[])public void visitEnd()
visitEnd in class org.objectweb.asm.MethodVisitor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||