Package org.jacoco.core.internal.instr
Class LocalProbeArrayStrategy
- java.lang.Object
-
- org.jacoco.core.internal.instr.LocalProbeArrayStrategy
-
- All Implemented Interfaces:
IProbeArrayStrategy
class LocalProbeArrayStrategy extends java.lang.Object implements IProbeArrayStrategy
The strategy for interfaces inlines the runtime access directly into the methods as this is the only method without keeping reference within this class. This is very inefficient as the runtime is contacted for every method invocation and therefore only used for static initializers in interfaces.
-
-
Field Summary
Fields Modifier and Type Field Description private IExecutionDataAccessorGenerator
accessorGenerator
private long
classId
private java.lang.String
className
private int
probeCount
-
Constructor Summary
Constructors Constructor Description LocalProbeArrayStrategy(java.lang.String className, long classId, int probeCount, IExecutionDataAccessorGenerator accessorGenerator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMembers(org.objectweb.asm.ClassVisitor delegate, int probeCount)
Adds additional class members required by this strategy.int
storeInstance(org.objectweb.asm.MethodVisitor mv, boolean clinit, int variable)
Creates code that stores the probe array instance in the given variable.
-
-
-
Field Detail
-
className
private final java.lang.String className
-
classId
private final long classId
-
probeCount
private final int probeCount
-
accessorGenerator
private final IExecutionDataAccessorGenerator accessorGenerator
-
-
Constructor Detail
-
LocalProbeArrayStrategy
LocalProbeArrayStrategy(java.lang.String className, long classId, int probeCount, IExecutionDataAccessorGenerator accessorGenerator)
-
-
Method Detail
-
storeInstance
public int storeInstance(org.objectweb.asm.MethodVisitor mv, boolean clinit, int variable)
Description copied from interface:IProbeArrayStrategy
Creates code that stores the probe array instance in the given variable.- Specified by:
storeInstance
in interfaceIProbeArrayStrategy
- Parameters:
mv
- visitor to create codeclinit
- true in case of<clinit>
methodvariable
- variable index to store probe array to- Returns:
- maximum stack size required by the generated code
-
addMembers
public void addMembers(org.objectweb.asm.ClassVisitor delegate, int probeCount)
Description copied from interface:IProbeArrayStrategy
Adds additional class members required by this strategy. This method is called after all original members of the class has been processed.- Specified by:
addMembers
in interfaceIProbeArrayStrategy
- Parameters:
delegate
- visitor to create fields and methodsprobeCount
- total number of probes required for this class
-
-