From c1a9321f29f76325f6fcf278c60678dcf9c71cde Mon Sep 17 00:00:00 2001 From: Robert Schuster Date: Wed, 1 Feb 2006 13:40:05 +0000 Subject: 2006-02-01 Robert Schuster * 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 --- libjava/include/jvm.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'libjava/include') diff --git a/libjava/include/jvm.h b/libjava/include/jvm.h index ca0aea8..7110971 100644 --- a/libjava/include/jvm.h +++ b/libjava/include/jvm.h @@ -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 **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__ */ -- cgit v1.1