Package org.jacoco.core.runtime
Class OfflineInstrumentationAccessGenerator
- java.lang.Object
-
- org.jacoco.core.runtime.OfflineInstrumentationAccessGenerator
-
- All Implemented Interfaces:
IExecutionDataAccessorGenerator
public class OfflineInstrumentationAccessGenerator extends java.lang.Object implements IExecutionDataAccessorGenerator
This implementation ofIExecutionDataAccessorGenerator
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 Modifier and Type Field Description private java.lang.String
runtimeClassName
-
Constructor Summary
Constructors Constructor Description OfflineInstrumentationAccessGenerator()
Creates a new instance for offline instrumentation.OfflineInstrumentationAccessGenerator(java.lang.String runtimeClassName)
Creates a new instance with the given runtime class name for testing purposes
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
generateDataAccessor(long classid, java.lang.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.
-
-
-
Constructor Detail
-
OfflineInstrumentationAccessGenerator
public OfflineInstrumentationAccessGenerator()
Creates a new instance for offline instrumentation.
-
OfflineInstrumentationAccessGenerator
OfflineInstrumentationAccessGenerator(java.lang.String runtimeClassName)
Creates a new instance with the given runtime class name for testing purposes- Parameters:
runtimeClassName
- VM name of the runtime class
-
-
Method Detail
-
generateDataAccessor
public int generateDataAccessor(long classid, java.lang.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
-
-