Re: [Aegisvm-devel] Small JNI patch for AegisVM
Status: Pre-Alpha
Brought to you by:
pwlfong
|
From: Philip F. <pw...@us...> - 2002-10-12 10:38:05
|
Hi Gildas,
I just committed your JNI code with the following log:
New feature: Implementation of JNI functions Throw, ThrowNew,
ExceptionOccurred, AllocObject, and NewObjectV. Based on a patch
contributed by Gildas Bazin <gb...@al...>.
I modified your patch a bit:
- I like the way you reuse primitive JNI functions to implement
higher level JNI functions. I push your idea as much as I could.
That is why some of the low level calls in ThrowNew & NewObjectV
are eliminated. The most noticable one is the elimination for the
need to create yet another method invocation function.
- As for accessibility, I am as lost as you are. The JNI spec does
not prescribe any accessibility tests at the sites you pointed out.
The general philosophy is that JNI should be allowed to by-pass
accessibility checks. This is actually how some of the built-in
classes are implemented. My guess is that we don't really need
anything at those two spots.
- ThrowNew: The local reference allocated for the string should
be released before returning.
- ExceptionOccurred: The exception object should be wrapped by
a local reference.
The rest are basically the same as your patch. Attached is the
diff I actually committed.
Philip
PS: Please let me know if you need ae_invoke_method_v for other
purpose. I'll then add it back.
On Sun, 22 Sep 2002, Gildas Bazin wrote:
> Hi,
>
> I implemented another few JNI functions:
>
> jint ae_jni_Throw(JNIEnv *env, jthrowable obj)
> jint ae_jni_ThrowNew(JNIEnv *env, jclass clazz, const char *message)
> jthrowable ae_jni_ExceptionOccurred(JNIEnv *env)
> jobject ae_jni_AllocObject(JNIEnv *env, jclass clazz)
> jobject ae_jni_NewObjectV(JNIEnv *env, jclass clazz, jmethodID methodID,
> va_list args)
>
> ae_jni_AllocObject, ae_jni_NewObjectV are not complete. They are missing an
> accessibility check at the beginning, but to be honest I don't really know
> how to do that and I'm kind of hoping you'll add it yourself ;-)
>
> Regards,
>
> --
> Gildas
--
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.
|