Package org.jacoco.core.internal.flow
Class LabelFlowAnalyzer
java.lang.Object
org.objectweb.asm.MethodVisitor
org.jacoco.core.internal.flow.LabelFlowAnalyzer
public final class LabelFlowAnalyzer
extends org.objectweb.asm.MethodVisitor
Method visitor to collect flow related information about the
Label
s
within a class. It calculates the properties "multitarget" and "successor"
that can afterwards be obtained via LabelInfo
.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) boolean
true
for the very first instruction only.(package private) org.objectweb.asm.Label
Label instance of the last line start.(package private) boolean
true
if the current instruction is a potential successor of the previous instruction.Fields inherited from class org.objectweb.asm.MethodVisitor
api, mv
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
markLabels
(org.objectweb.asm.tree.MethodNode method) Marks all labels of the method with control flow information.private void
private static void
setTargetIfNotDone
(org.objectweb.asm.Label label) void
visitFieldInsn
(int opcode, String owner, String name, String desc) void
visitIincInsn
(int var, int increment) void
visitInsn
(int opcode) 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
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
visitMethodInsn
(int opcode, String owner, String name, String desc, boolean itf) void
visitMultiANewArrayInsn
(String desc, int dims) private void
visitSwitchInsn
(org.objectweb.asm.Label dflt, org.objectweb.asm.Label[] labels) void
visitTableSwitchInsn
(int min, int max, org.objectweb.asm.Label dflt, org.objectweb.asm.Label... labels) void
visitTryCatchBlock
(org.objectweb.asm.Label start, org.objectweb.asm.Label end, org.objectweb.asm.Label handler, String type) void
visitTypeInsn
(int opcode, String type) void
visitVarInsn
(int opcode, int var) Methods inherited from class org.objectweb.asm.MethodVisitor
getDelegate, visitAnnotableParameterCount, visitAnnotation, visitAnnotationDefault, visitAttribute, visitCode, visitEnd, visitFrame, visitInsnAnnotation, visitLocalVariable, visitLocalVariableAnnotation, visitMaxs, visitMethodInsn, visitParameter, visitParameterAnnotation, visitTryCatchAnnotation, visitTypeAnnotation
-
Field Details
-
successor
boolean successortrue
if the current instruction is a potential successor of the previous instruction. Accessible for testing. -
first
boolean firsttrue
for the very first instruction only. Accessible for testing. -
lineStart
org.objectweb.asm.Label lineStartLabel instance of the last line start.
-
-
Constructor Details
-
LabelFlowAnalyzer
public LabelFlowAnalyzer()Create new instance.
-
-
Method Details
-
markLabels
public static void markLabels(org.objectweb.asm.tree.MethodNode method) Marks all labels of the method with control flow information.- Parameters:
method
- Method to mark labels
-
visitTryCatchBlock
public void visitTryCatchBlock(org.objectweb.asm.Label start, org.objectweb.asm.Label end, org.objectweb.asm.Label handler, String type) - Overrides:
visitTryCatchBlock
in classorg.objectweb.asm.MethodVisitor
-
visitJumpInsn
public void visitJumpInsn(int opcode, org.objectweb.asm.Label label) - Overrides:
visitJumpInsn
in classorg.objectweb.asm.MethodVisitor
-
visitLabel
public void visitLabel(org.objectweb.asm.Label label) - Overrides:
visitLabel
in classorg.objectweb.asm.MethodVisitor
-
visitLineNumber
public void visitLineNumber(int line, org.objectweb.asm.Label start) - Overrides:
visitLineNumber
in classorg.objectweb.asm.MethodVisitor
-
visitTableSwitchInsn
public void visitTableSwitchInsn(int min, int max, org.objectweb.asm.Label dflt, org.objectweb.asm.Label... labels) - Overrides:
visitTableSwitchInsn
in classorg.objectweb.asm.MethodVisitor
-
visitLookupSwitchInsn
public void visitLookupSwitchInsn(org.objectweb.asm.Label dflt, int[] keys, org.objectweb.asm.Label[] labels) - Overrides:
visitLookupSwitchInsn
in classorg.objectweb.asm.MethodVisitor
-
visitSwitchInsn
private void visitSwitchInsn(org.objectweb.asm.Label dflt, org.objectweb.asm.Label[] labels) -
setTargetIfNotDone
private static void setTargetIfNotDone(org.objectweb.asm.Label label) -
visitInsn
public void visitInsn(int opcode) - Overrides:
visitInsn
in classorg.objectweb.asm.MethodVisitor
-
visitIntInsn
public void visitIntInsn(int opcode, int operand) - Overrides:
visitIntInsn
in classorg.objectweb.asm.MethodVisitor
-
visitVarInsn
public void visitVarInsn(int opcode, int var) - Overrides:
visitVarInsn
in classorg.objectweb.asm.MethodVisitor
-
visitTypeInsn
- Overrides:
visitTypeInsn
in classorg.objectweb.asm.MethodVisitor
-
visitFieldInsn
- Overrides:
visitFieldInsn
in classorg.objectweb.asm.MethodVisitor
-
visitMethodInsn
- Overrides:
visitMethodInsn
in classorg.objectweb.asm.MethodVisitor
-
visitInvokeDynamicInsn
public void visitInvokeDynamicInsn(String name, String desc, org.objectweb.asm.Handle bsm, Object... bsmArgs) - Overrides:
visitInvokeDynamicInsn
in classorg.objectweb.asm.MethodVisitor
-
markMethodInvocationLine
private void markMethodInvocationLine() -
visitLdcInsn
- Overrides:
visitLdcInsn
in classorg.objectweb.asm.MethodVisitor
-
visitIincInsn
public void visitIincInsn(int var, int increment) - Overrides:
visitIincInsn
in classorg.objectweb.asm.MethodVisitor
-
visitMultiANewArrayInsn
- Overrides:
visitMultiANewArrayInsn
in classorg.objectweb.asm.MethodVisitor
-