Re: [Aegisvm-devel] patch to jni.c
Status: Pre-Alpha
Brought to you by:
pwlfong
|
From: Philip F. <pw...@us...> - 2002-07-24 23:54:56
|
Hi, On Tue, 23 Jul 2002, Gildas Bazin wrote: > As I told you in my last mail (which btw is still waiting for moderator > approval due to my silly mistake of using a different mail account) I did > quite a few modifications to the JNI code in AegisVM. No, the fault is mine. I was busy working on something else last week and didn't reply your mail promptly. > The first part of the changes consist of code factorisation which does > reduce the size of jni.c by a fair amount. For instance all the > ae_jni_Call*Method() functions are quite similar and thus it is possible to > generate them all from a single macro, a new ae_jni_CallMethodA() also > regroups all the common code for all the ae_jni_Call* variants (including > static and virtual). 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. > 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 have some criticism about this patch or needs me to rework some of > it, do not hesitate to tell me. BTW, which release (or cvs tag) was your previous patch made out of? Again, thanks. Philip -- Philip W. L. Fong pw...@us... The Aegis VM Project http://aegisvm.sourceforge.net The Aegis VM Project is an on-going effort to implement a lightweight, secure JVM. It will eventually feature a modular architecture, Proof Linking, that supports pluggable verification modules. |