[kaffe] libraries/clib/native/Field.c

Godmar Back gback at cs.utah.edu
Wed May 8 08:32:16 PDT 2002


> 
> On Tue, 7 May 2002, Godmar Back wrote:
> > Methods that start with Java_ are called using the JNI calling convention.
> > See jni.c::Kaffe_JNI_native 
> 
> Oops, I wasn't paying attention to the function names. In that case, the
> question becomes whether those functions should use the JNI or straight
> calling convention; PocketLinux uses JNI for them, which does make some
> things easier... But I went with the flow and simply turned them into
> straight calls as was originally intended. Also modified the exception to
> match the form of Sun JDK, so that the earlier posted test-case passes.
> Overall it doesn't appear JNI convention is used in many classes; are
> there some specific constraints on choosing one over the other?
> 

JNI is of course slower than KNI per function call.  
For some things, you need JNI however.  It's all historical.

I think back then we had agreed to use JNI for new functions, but
to not bother converting existing functions to JNI.  This applies to
functions in the native libraries that are very VM-specific, such
as the reflection stuff - less VM-specific (and all user-written)
native methods should use JNI.

Also, I'm not sure you want to match Sun's printout - it's not like
this remains constant over JDK versions.

	- Godmar





More information about the kaffe mailing list