[patch] JNI performance improvements

Tom Tromey tromey@redhat.com
Fri Jan 14 17:13:00 GMT 2005


>>>>> "Bryce" == Bryce McKinlay <mckinlay@redhat.com> writes:

>> +  if (env->bottom_locals != NULL)
>> +    _Jv_Free (env->bottom_locals);
>> +  _Jv_Free (env);

Bryce> Why don't we just GC-allocate these - ie _Jv_AllocBytes() ? Then we
Bryce> wouldn't need _Jv_FreeJNIEnv.

The Thread native data is not scanned by the GC.  Neither is the
JNIEnv (so bottom_locals would always appear to be garbage).

I think we should finally expose a way to allocate conservatively
scanned memory.  We can make it libgcj-only and not expose it to CNI.
If we ever do end up in the unlikely position of integrating a
non-conservative GC, we could just go through libgcj and change the 10
places using this API to register layout info instead.

If we did this, we could scan each frame in the JNIEnv.  Then we could
get rid of the reference counting for local references, and associated
locking.

Tom



More information about the Java-patches mailing list