-
Enhancement
-
Resolution: Fixed
-
P3
-
1.3.0
-
beta
-
generic
-
generic
Name: laC46010 Date: 05/26/99
Java Virtual Machine Profiler Interface (JVMPI) supports a range of
events like: class loading/unloading, method calling, etc.
However, finer grained events like execution of a linear block or
a branch instruction are not supported but might be required by some tools.
For example, Java Code Coverage Tool (Jcov) needs to receive and process
events like start of linear blocks of code or execution of branch
instructions (see rfe#4241370).
It is proposed to add new event type to the JVMPI: JVMPI_EVENT_INSTRUCTION_START.
This event should be generated at every JVM instruction's execution.
The event-specific data for JVMPI_EVENT_INSTR_EXEC uniquely identifies the instruction:
- id of the method the executed instruction belongs to
- instruction offset in the method's bytecode
Additional information is provided for certain instructions.
That information is instruction specific.
The data structure, representing JVMPI_EVENT_INSTRUCTION_START
event-specific data is the following:
#define JVMPI_EVENT_INSTRUCTION_START ((jint)9)
struct {
jmethodID method_id; /* id of the method the instruction belongs to */
jint offset; /* instruction offset in the method's bytecode */
union {
struct {
jboolean is_true; /* whether true or false branch is taken */
} if_info;
struct {
jint key; /* top stack value used as an index */
jint low; /* min value of the index */
jint hi; /* max value of the index */
} tableswitch_info;
struct {
jint chosen_pair_index; /* actually chosen pair index (0-based) */
jboolean is_default; /* whether default branch is taken */
} lookupswitch_info;
} u;
} instruction;
======================================================================