natClassLoader.cc (_Jv_PrepareCompiledClass): Call _Jv_PushClass.
2002-12-03 Andrew Haley <aph@redhat.com> * java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Call _Jv_PushClass. (_Jv_InitNewClassFields): Set protectionDomain and chain = NULL. (_Jv_PopClass): New. (_Jv_PushClass): New. * java/lang/natClass.cc (forName (jstring)): Use a StackTrace to discover the ClassLoader of our caller. (_Jv_CheckArrayStore): Don't check that a class is assignment compatible with Object. * java/lang/natVMTHrowable.cc: Delete. * gnu/gcj/runtime/StackTrace.java: New, partly copied from java.lang.VMThrowable. (StackTrace(), StackTrace(int)): New constructors. (classAt, methodAt, update, methodAtAddress): New methods. (map): New field. * java/lang/VMThrowable.java: Use StackTrace instead of natVMTHrowable. * java/lang/Class.h (getClassLoaderInternal): New. (class Class): Be friendly with _Jv_PopClass and _Jv_PushClass. Be friendly with gnu::gcj::runtime::StackTrace. (Object.chain): New field. * include/java-interp.h (class _Jv_InterpMethod): Be friendly with gnu::gcj::runtime::StackTrace. * prims.cc (_Jv_NewObjectArray): Use getClassLoaderInternal() instead of getClassLoader(). * verify.cc (class _Jv_BytecodeVerifier): Likewise. java::lang::VMThrowable. * Makefile.am (core_java_source_files): Add MethodRef.java, StackTrace.java. (nat_source_files): Remove natVMThrowable.cc; add natStackTrace.cc. * Makefile.in: Rebuild. 2002-12-03 Andrew Haley <aph@redhat.com> * class.c (make_class_data): New field, "chain". * decl.c (java_init_decl_processing): Likewise. From-SVN: r59769
This commit is contained in:
parent
ee7ecb2924
commit
421f9e6091
12 changed files with 131 additions and 39 deletions
|
@ -20,6 +20,7 @@ details. */
|
|||
#include <java/lang/reflect/Modifier.h>
|
||||
#include <java/security/ProtectionDomain.h>
|
||||
#include <java/lang/Package.h>
|
||||
#include <gnu/gcj/runtime/StackTrace.h>
|
||||
|
||||
// We declare these here to avoid including gcj/cni.h.
|
||||
extern "C" void _Jv_InitClass (jclass klass);
|
||||
|
@ -138,6 +139,13 @@ public:
|
|||
|
||||
java::lang::ClassLoader *getClassLoader (void);
|
||||
|
||||
// This is an internal method that circumvents the usual security
|
||||
// checks when getting the class loader.
|
||||
java::lang::ClassLoader *getClassLoaderInternal (void)
|
||||
{
|
||||
return loader;
|
||||
}
|
||||
|
||||
java::lang::reflect::Constructor *getConstructor (JArray<jclass> *);
|
||||
JArray<java::lang::reflect::Constructor *> *getConstructors (void);
|
||||
java::lang::reflect::Constructor *getDeclaredConstructor (JArray<jclass> *);
|
||||
|
@ -296,6 +304,8 @@ private:
|
|||
java::lang::ClassLoader *loader);
|
||||
friend jclass _Jv_FindClassInCache (_Jv_Utf8Const *name,
|
||||
java::lang::ClassLoader *loader);
|
||||
friend jclass _Jv_PopClass (void);
|
||||
friend void _Jv_PushClass (jclass k);
|
||||
friend void _Jv_NewArrayClass (jclass element,
|
||||
java::lang::ClassLoader *loader,
|
||||
_Jv_VTable *array_vtable = 0);
|
||||
|
@ -349,6 +359,7 @@ private:
|
|||
#endif
|
||||
|
||||
friend class _Jv_BytecodeVerifier;
|
||||
friend class gnu::gcj::runtime::StackTrace;
|
||||
|
||||
// Chain for class pool.
|
||||
jclass next;
|
||||
|
@ -403,6 +414,8 @@ private:
|
|||
jclass arrayclass;
|
||||
// Security Domain to which this class belongs (or null).
|
||||
java::security::ProtectionDomain *protectionDomain;
|
||||
// Used by Jv_PopClass and _Jv_PushClass to communicate with StackTrace.
|
||||
jclass chain;
|
||||
};
|
||||
|
||||
#endif /* __JAVA_LANG_CLASS_H__ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue