Package org.jacoco.core.runtime
Class OfflineInstrumentationAccessGenerator
java.lang.Object
org.jacoco.core.runtime.OfflineInstrumentationAccessGenerator
- All Implemented Interfaces:
IExecutionDataAccessorGenerator
public class OfflineInstrumentationAccessGenerator
extends Object
implements IExecutionDataAccessorGenerator
This implementation of
IExecutionDataAccessorGenerator
generate a
direct dependency to the JaCoCo runtime agent to initialize the runtime and
obtain probe arrays. This generator is designed for offline instrumentation
only.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance for offline instrumentation.OfflineInstrumentationAccessGenerator
(String runtimeClassName) Creates a new instance with the given runtime class name for testing purposes -
Method Summary
Modifier and TypeMethodDescriptionint
generateDataAccessor
(long classid, String classname, int probecount, org.objectweb.asm.MethodVisitor mv) This method generates the byte code required to obtain the coverage data structure for the class with the given id.
-
Field Details
-
runtimeClassName
-
-
Constructor Details
-
OfflineInstrumentationAccessGenerator
public OfflineInstrumentationAccessGenerator()Creates a new instance for offline instrumentation. -
OfflineInstrumentationAccessGenerator
OfflineInstrumentationAccessGenerator(String runtimeClassName) Creates a new instance with the given runtime class name for testing purposes- Parameters:
runtimeClassName
- VM name of the runtime class
-
-
Method Details
-
generateDataAccessor
public int generateDataAccessor(long classid, String classname, int probecount, org.objectweb.asm.MethodVisitor mv) Description copied from interface:IExecutionDataAccessorGenerator
This method generates the byte code required to obtain the coverage data structure for the class with the given id. Typically the instrumentation process will embed this code into a method that is called on class initialization. This method can be called at any time even outside the target VM. The generated code must push aboolean[]
instance to the operand stack. Except this result object the generated code must not make any assumptions about the structure of the embedding method or class. The generated code must not use or allocate local variables.- Specified by:
generateDataAccessor
in interfaceIExecutionDataAccessorGenerator
- Parameters:
classid
- identifier of the classclassname
- VM class nameprobecount
- probe count for this classmv
- code output- Returns:
- additional stack size required by the implementation, including the instance pushed to the stack
-