2006-02-01 Robert Schuster <robertschuster@fsfe.org>
* link.cc: (_Jv_Linker::find_field_helper): Added checks. (_Jv_Linker::find_field): Use exception swallowing class resolution and added early return. (_Jv_ThrowNoClassDefFoundErrorTrampoline): New function. (_Jv_Linker::link_symbol_table): Use exception swallowing class resolution, added ffi_closure installation routine, use _Jv_ThrowNoClassDefFoundError for missing static method. (_Jv_Linker::ensure_class_linked): Added string check which does not trigger class resolution. * java/lang/natClassLoader.cc: (_Jv_FindClassNoException): New method. * java/lang/Class.h: (_Jv_FindClassNoException): New method declaration. * include/jvm.h: (_Jv_FindClassNoException): New method declaration. (_Jv_FindClassFromSignatureNoException): New method declaration. * prims.cc: (_Jv_FindClassFromSignatureNoException): New method. * gcj/javaprims.h: (_Jv_equalsUtf8Classname): New method declaration. (_Jv_isPrimitiveOrDerived): Dito. * prims.cc: (_Jv_equalsUtf8Classnames): New method. (_Jv_isPrimitiveOrDerived): New method. * verify.cc: (ref_intersection::equals): Use new classname comparison method. (type::compatible): Use new classname comparison method. Added check whether LHS' type is java.lang.Object . (type::resolve): Added new optional debug message and simplified if-expression. (type::to_array): Added codepath that generates an array type without resolving the element type. From-SVN: r110474
This commit is contained in:
parent
168b93e9e3
commit
c1a9321f29
9 changed files with 491 additions and 46 deletions
|
@ -239,7 +239,7 @@ class _Jv_Linker
|
|||
{
|
||||
private:
|
||||
static _Jv_Field *find_field_helper(jclass, _Jv_Utf8Const *, _Jv_Utf8Const *,
|
||||
jclass *);
|
||||
jclass, jclass *);
|
||||
static _Jv_Field *find_field(jclass, jclass, jclass *, _Jv_Utf8Const *,
|
||||
_Jv_Utf8Const *);
|
||||
static void prepare_constant_time_tables(jclass);
|
||||
|
@ -271,7 +271,7 @@ public:
|
|||
static void print_class_loaded (jclass);
|
||||
static void resolve_class_ref (jclass, jclass *);
|
||||
static void wait_for_state(jclass, int);
|
||||
static _Jv_word resolve_pool_entry (jclass, int);
|
||||
static _Jv_word resolve_pool_entry (jclass, int, bool =false);
|
||||
static void resolve_field (_Jv_Field *, java::lang::ClassLoader *);
|
||||
static void verify_type_assertions (jclass);
|
||||
};
|
||||
|
@ -463,9 +463,18 @@ extern "C" jobject _Jv_UnwrapJNIweakReference (jobject);
|
|||
|
||||
extern jclass _Jv_FindClass (_Jv_Utf8Const *name,
|
||||
java::lang::ClassLoader *loader);
|
||||
|
||||
extern jclass _Jv_FindClassNoException (_Jv_Utf8Const *name,
|
||||
java::lang::ClassLoader *loader);
|
||||
|
||||
extern jclass _Jv_FindClassFromSignature (char *,
|
||||
java::lang::ClassLoader *loader,
|
||||
char ** = NULL);
|
||||
|
||||
extern jclass _Jv_FindClassFromSignatureNoException (char *,
|
||||
java::lang::ClassLoader *loader,
|
||||
char ** = NULL);
|
||||
|
||||
extern void _Jv_GetTypesFromSignature (jmethodID method,
|
||||
jclass declaringClass,
|
||||
JArray<jclass> **arg_types_out,
|
||||
|
@ -643,4 +652,14 @@ _Jv_IsBinaryCompatibilityABI (jclass c)
|
|||
return c->otable_syms || c->atable_syms || c->itable_syms;
|
||||
}
|
||||
|
||||
// Returns whether the given class does not really exists (ie. we have no
|
||||
// bytecode) but still allows us to do some very conservative actions.
|
||||
// E.g. throwing a NoClassDefFoundError with the name of the missing
|
||||
// class.
|
||||
extern inline jboolean
|
||||
_Jv_IsPhantomClass (jclass c)
|
||||
{
|
||||
return c->state == JV_STATE_PHANTOM;
|
||||
}
|
||||
|
||||
#endif /* __JAVA_JVM_H__ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue