JNI without Jni_Lookup() ?

Tom Tromey tromey@redhat.com
Tue Apr 20 05:23:00 GMT 2004


>>>>> "Erik" == Erik Poupaert <erik.poupaert@skynet.be> writes:

Erik> I guess, however, that simply defaulting to what javah
Erik> generates, as the single acceptable mangling variant, would be a
Erik> very acceptable solution.

Sure, I agree.  But JNI still uses a different calling convention than
ordinary code.  You can get around this by pushing the knowledge to
the callers.  But then you end up making a lot of things more fragile:
both the interpreter and reflection have to know about the new magic
arguments, as well as all compiled code (in fact this impacts binary
compatibility).

So it isn't easy.  These are all reasons we ended up with the stub
approach.  And, anyway, the lookup isn't the overhead, as Bryce has so
nicely demonstrated.  I'm sure that PR will be fixed sometime --
especially if it is API-related, since we'll want to fix it before
finalizing the library interface.

Tom



More information about the Java mailing list