Package org.jacoco.core.internal.instr
Class InterfaceFieldProbeArrayStrategy
- java.lang.Object
-
- org.jacoco.core.internal.instr.InterfaceFieldProbeArrayStrategy
-
- All Implemented Interfaces:
IProbeArrayStrategy
class InterfaceFieldProbeArrayStrategy extends java.lang.Object implements IProbeArrayStrategy
This strategy for Java 8 interfaces adds a static method requesting the probe array from the runtime, a static field to hold the probe array and adds code for its initialization into interface initialization method.
-
-
Field Summary
Fields Modifier and Type Field Description private IExecutionDataAccessorGeneratoraccessorGeneratorprivate longclassIdprivate java.lang.StringclassNameprivate static java.lang.Object[]FRAME_LOCALS_EMPTYEmpty frame locals.private static java.lang.Object[]FRAME_STACK_ARRZFrame stack with a single boolean array.private intprobeCountprivate booleanseenClinit
-
Constructor Summary
Constructors Constructor Description InterfaceFieldProbeArrayStrategy(java.lang.String className, long classId, int probeCount, IExecutionDataAccessorGenerator accessorGenerator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMembers(org.objectweb.asm.ClassVisitor cv, int probeCount)Adds additional class members required by this strategy.private voidcreateClinitMethod(org.objectweb.asm.ClassVisitor cv, int probeCount)private voidcreateDataField(org.objectweb.asm.ClassVisitor cv)private voidcreateInitMethod(org.objectweb.asm.ClassVisitor cv, int probeCount)intstoreInstance(org.objectweb.asm.MethodVisitor mv, boolean clinit, int variable)Creates code that stores the probe array instance in the given variable.
-
-
-
Field Detail
-
FRAME_STACK_ARRZ
private static final java.lang.Object[] FRAME_STACK_ARRZ
Frame stack with a single boolean array.
-
FRAME_LOCALS_EMPTY
private static final java.lang.Object[] FRAME_LOCALS_EMPTY
Empty frame locals.
-
className
private final java.lang.String className
-
classId
private final long classId
-
probeCount
private final int probeCount
-
accessorGenerator
private final IExecutionDataAccessorGenerator accessorGenerator
-
seenClinit
private boolean seenClinit
-
-
Constructor Detail
-
InterfaceFieldProbeArrayStrategy
InterfaceFieldProbeArrayStrategy(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:IProbeArrayStrategyCreates code that stores the probe array instance in the given variable.- Specified by:
storeInstancein 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 cv, int probeCount)Description copied from interface:IProbeArrayStrategyAdds additional class members required by this strategy. This method is called after all original members of the class has been processed.- Specified by:
addMembersin interfaceIProbeArrayStrategy- Parameters:
cv- visitor to create fields and methodsprobeCount- total number of probes required for this class
-
createDataField
private void createDataField(org.objectweb.asm.ClassVisitor cv)
-
createInitMethod
private void createInitMethod(org.objectweb.asm.ClassVisitor cv, int probeCount)
-
createClinitMethod
private void createClinitMethod(org.objectweb.asm.ClassVisitor cv, int probeCount)
-
-