Re: [Aegisvm-devel] patch to jni.c
Status: Pre-Alpha
Brought to you by:
pwlfong
|
From: Gildas B. <gb...@al...> - 2002-07-25 10:19:37
|
On Thursday 25 July 2002 01:54, Philip Fong wrote: > Hi, > > Hmm, I am usually not very fond of such use of macros. But I see your > point though. The various method invocation routines definitely need > a lot of factoring. I am still thinking about how to do this the > right way. My experience is that most of the nasty bugs I have seen have > to do with either the garbage collector or one of the method invocation > routines. These functions are extremely delicate, and break very > easily. My fear is that using macro-based templates might make the > code even more cryptic. However, I welcome any thoughts you might > have on this matter. > I am not found of them either ;-) The main motivation for using such macros is to replace the multitude of small wrapper functions that jni.c is using. All the Call##JType##Method*() functions are in fact wrappers around ae_jni_CallMethodA() where the bulk of the work is done anyway. ae_jni_CallMethodA() is the important function where all the improvements are likely to be done in the future, the wrappers themselves shouldn't have to change much. But I guess this is also a matter of taste ;-) > > The second part of the changes is an attempt to implement more of the JNI > > functions. These changes need to be reviewed carefully as I'm not entirely > > sure I understood all the subtilities involved, even though they all seem > > to work correctly. > > List of implemented functions: > > - all the ae_jni_Call##JType##Method*() > > - ae_jni_GetFieldID() > > - all the ae_jni_Get/Set##JType##Field() > > - ae_jni_GetStringUTFLength() > > - ae_jni_GetStringUTFChars() > > - ae_jni_ReleaseStringUTFChars() > > - ae_jni_GetArrayLength() > > This is perfect! As I mentioned before, we could probably discuss a bit > more before we give a good shot at the ae_jni_Call##JType##Method*() > functions, but it would be extremely nice if you would be able to help > out with implementing the rest. Thanks in advance. > If you want me to send you a patch without the macros I can do it (not that I will like to do it, but I can ;-). One of the reasons why I started implementing these JNI functions is that I'm trying to run the mauve java testsuite (http://sources.redhat.com/mauve/) on AegisVM but the testsuite doesn't even bootstrap with the current AegisVM cvs because of missing JNI functions and a few other things. It's almost working though and I will send you the remaining patches when it is. > > BTW, which release (or cvs tag) was your previous patch made out of? > Current cvs :) Regards, -- Gildas |