This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: JNI in GCJ 3.2 for Win32
Tom Tromey wrote:
If we're going to change _Jv_LookupJNIMethod, let's solve the other
problem at the same time. I think it could look like this:
void _Jv_LookupJNIMethod (jclass klass, _Jv_Utf8Const *name,
_Jv_Utf8Const *signature,
void (**function) (), int arg_size);
The new implementation would synchronize on something, and would fill
in *FUNCTION with the pointer to the function it found.
a) The current implementation already synchronises on global_ref_table.
b) What's wrong with returning the found function ptr?
Sorry, I seem to be missing something - you need to hit me on the
head with a trout to make me understand this. ;-)
If you do this you'll also need to change the declaration of
_Jv_LookupJNIMethod in decl.c (to change the return type).
That looks too voodoo for a mere mortal like me!
I just want to tell the native compiler to pass another parameter
set to the real number of bytes passed as arguments to the called
function.
I can't even seem to be able to trace where exactly it is specifying
the FFI ABI to use, leave alone making the change noted above. :-(
The interpreter on the other hand worked like a charm - I modified
it to send the number of bytes (_this->args_real_size + sizeof (env *)
[+ sizeof( class *) if it is a static method]) to the lookup
function, and the lookup function itself to lookup "fooBar@nn" on Win32
and now gij can run bytecode that calls static as well as member
methods. Cool!
Sincerely Yours,
Ranjit.
--
Ranjit Mathew Email: rmathew AT hotmail DOT com
Bangalore,
INDIA. Web: http://ranjitmathew.tripod.com/