Kaffe native interface proposal

Per Bothner bothner at cygnus.com
Thu Nov 27 11:17:06 PST 1997

Alex Boisvert <boia01 at gel.usherb.ca> writes:
> I understand we are saving a few function calls,

It's more than that.  Consider calling a method.  First you need to do
a GetMethodID, which means searching the method table at run-time.
Then you call (say) CallIntMethod.  This takes a list of arguments.
The implementation of CallIntMethod needs to interpret the signature
of the method, use that to get the correct values from the actual
argument list, and then marshall the arguments into whatever
calling convention is used by the actual method.  It is hard to see
how this could take less than tens of instructions *per argument*,
unless all methods use a calling convention optimized for JNI,
which would lead to a loss of performance overall.

There are also space overheads.  JNI requires a lot of reflective
information.  It would be nice to be able to leave some of that
out in memory-tight environments.

> In other words, what's the overhead of JNI's 
> environment (data & function members) access functions?

At this point we can only guess.  After KNI and JNI are implemented
we can be more specific.

	--Per Bothner
Cygnus Solutions     bothner at cygnus.com     http://www.cygnus.com/~bothner

More information about the kaffe mailing list