jni.cc (_Jv_JNI_GetAnyFieldID): Handle unresolved fields.

* jni.cc (_Jv_JNI_GetAnyFieldID): Handle unresolved fields.
	* java/lang/reflect/natField.cc (getType): Use _Jv_ResolveField
	unconditionally.
	* include/jvm.h (_Jv_ResolveField): Declare.
	* include/java-interp.h (_Jv_ResolveField): Don't declare.
	* resolve.cc (_Jv_ResolveField): No longer conditional on
	INTERPRETER.

From-SVN: r40785
This commit is contained in:
Tom Tromey 2001-03-23 19:15:44 +00:00 committed by Tom Tromey
parent e9f4fa7143
commit 83c64db681
7 changed files with 40 additions and 33 deletions

View file

@ -1,6 +1,6 @@
// resolve.cc - Code for linking and resolving classes and pool entries.
/* Copyright (C) 1999, 2000 Free Software Foundation
/* Copyright (C) 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@ -32,6 +32,17 @@ details. */
#include <java/lang/IncompatibleClassChangeError.h>
#include <java/lang/reflect/Modifier.h>
void
_Jv_ResolveField (_Jv_Field *field, java::lang::ClassLoader *loader)
{
if (! field->isResolved ())
{
_Jv_Utf8Const *sig = (_Jv_Utf8Const*)field->type;
field->type = _Jv_FindClassFromSignature (sig->data, loader);
field->flags &= ~_Jv_FIELD_UNRESOLVED_FLAG;
}
}
#ifdef INTERPRETER
static void throw_internal_error (char *msg)
@ -361,17 +372,6 @@ _Jv_SearchMethodInClass (jclass cls, jclass klass,
return 0;
}
void
_Jv_ResolveField (_Jv_Field *field, java::lang::ClassLoader *loader)
{
if (! field->isResolved ())
{
_Jv_Utf8Const *sig = (_Jv_Utf8Const*)field->type;
field->type = _Jv_FindClassFromSignature (sig->data, loader);
field->flags &= ~_Jv_FIELD_UNRESOLVED_FLAG;
}
}
/** FIXME: this is a terribly inefficient algorithm! It would improve
things if compiled classes to know vtable offset, and _Jv_Method had
a field for this.