Patch: JVMPI

Tom Tromey tromey@cygnus.com
Mon Mar 27 11:12:00 GMT 2000


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

Cool.

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> 	* boehm.cc: 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 boehm.cc, since it isn't handled in the GC itself.

These functions must also be defined in nogc.cc.
  
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
jni.h.

Tom


More information about the Java-patches mailing list