Commit a5c30a8c by Tom Tromey Committed by Tom Tromey

* jni.cc (_Jv_JNI_NewLocalRef): Search other frames.

From-SVN: r43415
parent 827a5be7
2001-06-15 Tom Tromey <tromey@redhat.com> 2001-06-15 Tom Tromey <tromey@redhat.com>
* jni.cc (_Jv_JNI_NewLocalRef): Search other frames.
2001-06-15 Tom Tromey <tromey@redhat.com>
* java/lang/natRuntime.cc (_Jv_FindSymbolInExecutable): Return * java/lang/natRuntime.cc (_Jv_FindSymbolInExecutable): Return
NULL if no library on the list has the symbol. NULL if no library on the list has the symbol.
(init): Call add_library on the program itself. (init): Call add_library on the program itself.
......
...@@ -278,9 +278,10 @@ _Jv_JNI_NewLocalRef (JNIEnv *env, jobject obj) ...@@ -278,9 +278,10 @@ _Jv_JNI_NewLocalRef (JNIEnv *env, jobject obj)
// Try to find an open slot somewhere in the topmost frame. // Try to find an open slot somewhere in the topmost frame.
_Jv_JNI_LocalFrame *frame = env->locals; _Jv_JNI_LocalFrame *frame = env->locals;
bool done = false, set = false; bool done = false, set = false;
while (frame != NULL && ! done) for (; frame != NULL && ! done; frame = frame->next)
{ {
for (int i = 0; i < frame->size; ++i) for (int i = 0; i < frame->size; ++i)
{
if (frame->vec[i] == NULL) if (frame->vec[i] == NULL)
{ {
set = true; set = true;
...@@ -290,6 +291,12 @@ _Jv_JNI_NewLocalRef (JNIEnv *env, jobject obj) ...@@ -290,6 +291,12 @@ _Jv_JNI_NewLocalRef (JNIEnv *env, jobject obj)
} }
} }
// If we found a slot, or if the frame we just searched is the
// mark frame, then we are done.
if (done || frame->marker != MARK_NONE)
break;
}
if (! set) if (! set)
{ {
// No slots, so we allocate a new frame. According to the spec // No slots, so we allocate a new frame. According to the spec
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment