daniel.daugherty@Eng 2000-02-04
This e-mail came in from one of the HotSpot JVM/PI beta sites:
> HotSpot JVMPI has a new instruction level trace event, and two new
> interface functions for mapping JNI to JVMPI ids and vice versa, but has
> the same JVMPI version number as the classic one.
>
> What's the official way to tell if you've got the new features?
The second e-mail came in after we acknowledged that we needed to
update the JVM/PI revision number and asked if he could work around the
problem for now.
> I kind of can, but I'm not really pleased with how. :-( Since the change
> is really two new function pointers at the end of the interface
> structure, I can look at them and see if they look "sane". In your 1.2
> JDK's, the interface is immediately followed by the jvmpi_event_info
> table, which is zeroed out by default, so if I assume it's the new
> interface, and check the pointers they are both NULL. This happens to be
> true in the IBM VM we are looking at as well, but I don't have source
> for that so I can't verify that it always will be. And of course it's
> possible though unlikely that in some VM it's not even safe to look at
> the pointers, since they might be past the end of the interface struct
> and so maybe not even mapped or something.
>
> This is what I'll be using for now, though, I suppose. If the two
> pointers are non-null and "close" to each other and to the other
> interface functions, I can guess that it's probably HotSpot. If you have
> a cleaner method, let me know.
>
> I can't really call them to check (along with signal handlers and setjmp
> and longjmp in case they're not) because I need to know at JVM_OnLoad
> time, and so I don't have a valid jobject or jobjectID to call them
> with, and I don't think I can just assume that they'd handle NULL well
> (for example). And I'm not really wild about the idea of calling
> functions that might not be there anyway. :-/
This e-mail came in from one of the HotSpot JVM/PI beta sites:
> HotSpot JVMPI has a new instruction level trace event, and two new
> interface functions for mapping JNI to JVMPI ids and vice versa, but has
> the same JVMPI version number as the classic one.
>
> What's the official way to tell if you've got the new features?
The second e-mail came in after we acknowledged that we needed to
update the JVM/PI revision number and asked if he could work around the
problem for now.
> I kind of can, but I'm not really pleased with how. :-( Since the change
> is really two new function pointers at the end of the interface
> structure, I can look at them and see if they look "sane". In your 1.2
> JDK's, the interface is immediately followed by the jvmpi_event_info
> table, which is zeroed out by default, so if I assume it's the new
> interface, and check the pointers they are both NULL. This happens to be
> true in the IBM VM we are looking at as well, but I don't have source
> for that so I can't verify that it always will be. And of course it's
> possible though unlikely that in some VM it's not even safe to look at
> the pointers, since they might be past the end of the interface struct
> and so maybe not even mapped or something.
>
> This is what I'll be using for now, though, I suppose. If the two
> pointers are non-null and "close" to each other and to the other
> interface functions, I can guess that it's probably HotSpot. If you have
> a cleaner method, let me know.
>
> I can't really call them to check (along with signal handlers and setjmp
> and longjmp in case they're not) because I need to know at JVM_OnLoad
> time, and so I don't have a valid jobject or jobjectID to call them
> with, and I don't think I can just assume that they'd handle NULL well
> (for example). And I'm not really wild about the idea of calling
> functions that might not be there anyway. :-/