Patch: JVMPI

Tom Tromey
Mon Mar 27 11:12:00 GMT 2000

Anthony> The following patch implements partial support for JVMPI, the
Anthony> profiling interface.


Anthony> Some of the magic numbers aren't defined in the spec, so I
Anthony> made them up and noted them with FIXME's in the headers.

We should get them from Sun's header.
Usually, code written to interfaces like this (and JNI) should be
binary compatible between implementations.

I have some notes on the implementation.

Anthony> 	* Define GC_disable and GC_enable.
Anthony> 	(_Jv_DisableGC): New function.
Anthony> 	(_Jv_EnableGC): New function.

The user can make nested calls to these functions.  I think we have to
track this in, since it isn't handled in the GC itself.

These functions must also be defined in
Anthony> + extern void (*_Jv_JVMPI_Notify_OBJECT_ALLOC) (JVMPI_Event *event);
Anthony> + extern void (*_Jv_JVMPI_Notify_THREAD_END) (JVMPI_Event *event);
Anthony> + extern void (*_Jv_JVMPI_Notify_THREAD_START) (JVMPI_Event *event);

Could we declare these in a header somewhere?
Also, why call these instead of just calling through the global
JVMPI_Interface structure?

Anthony> + #pragma weak JNI_OnLoad
Anthony> +   extern jint JNI_OnLoad (JavaVM *, void *) __attribute__((weak));

Interesting approach :-).
Do we know that one or the other of these will always work?
I know that the #pragma doesn't work everywhere.

One last thing: we should install jvmpi.h in the same place we install


More information about the Java-patches mailing list