ClassLoader.java (setSigners): Implemented.

* java/lang/ClassLoader.java (setSigners): Implemented.
	* boehm.cc (_Jv_MarkObj): Mark `signers' field.
	* java/lang/natClassLoader.cc (_Jv_InitNewClassFields):
	Initialize new fields.
	* java/lang/Class.java (getSigners): Now native.
	(setSigners): Declare.
	* java/lang/natClass.cc (getSigners): New method.
	(getSigners): Likewise.
	* java/lang/Class.h (Class::signers): New field.
	(Class::setSigners): New method.

From-SVN: r72271
This commit is contained in:
Tom Tromey 2003-10-09 16:24:55 +00:00 committed by Tom Tromey
parent ae125b177e
commit b379e7b0e9
7 changed files with 37 additions and 6 deletions

View File

@ -1,3 +1,16 @@
2003-10-09 Tom Tromey <tromey@redhat.com>
* java/lang/ClassLoader.java (setSigners): Implemented.
* boehm.cc (_Jv_MarkObj): Mark `signers' field.
* java/lang/natClassLoader.cc (_Jv_InitNewClassFields):
Initialize new fields.
* java/lang/Class.java (getSigners): Now native.
(setSigners): Declare.
* java/lang/natClass.cc (getSigners): New method.
(getSigners): Likewise.
* java/lang/Class.h (Class::signers): New field.
(Class::setSigners): New method.
2003-10-09 Michael Koch <konqueror@gmx.de>
* java/rmi/server/RMIClassLoader.java:

View File

@ -206,6 +206,8 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void * /* env */)
MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, cDlabel);
p = (ptr_t) c->protectionDomain;
MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, cPlabel);
p = (ptr_t) c->signers;
MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, cSlabel);
#ifdef INTERPRETER
if (_Jv_IsInterpretedClass (c))

View File

@ -197,6 +197,7 @@ public:
java::net::URL *getResource (jstring resourceName);
java::io::InputStream *getResourceAsStream (jstring resourceName);
JArray<jobject> *getSigners (void);
void setSigners(JArray<jobject> *);
inline jclass getSuperclass (void)
{
@ -433,6 +434,8 @@ private:
jclass arrayclass;
// Security Domain to which this class belongs (or null).
java::security::ProtectionDomain *protectionDomain;
// Signers of this class (or null).
JArray<jobject> *signers;
// Used by Jv_PopClass and _Jv_PushClass to communicate with StackTrace.
jclass chain;
};

View File

@ -193,11 +193,8 @@ public final class Class implements Serializable
return packageName.substring (0, end+1) + resourceName;
}
// FIXME: implement. Requires java.security.
public Object[] getSigners ()
{
return null;
}
public native Object[] getSigners ();
native void setSigners(Object[] signers);
public native Class getSuperclass ();
public native boolean isArray ();

View File

@ -502,7 +502,7 @@ public abstract class ClassLoader
*/
protected final void setSigners(Class c, Object[] signers)
{
// c.setSigners(signers);
c.setSigners(signers);
}
/**

View File

@ -1534,6 +1534,18 @@ java::lang::Class::getProtectionDomain0 ()
return protectionDomain;
}
JArray<jobject> *
java::lang::Class::getSigners()
{
return signers;
}
void
java::lang::Class::setSigners(JArray<jobject> *s)
{
signers = s;
}
// Functions for indirect dispatch (symbolic virtual binding) support.
// There are two tables, atable and otable. atable is an array of

View File

@ -539,6 +539,9 @@ _Jv_InitNewClassFields (jclass ret)
ret->field_count = 0;
ret->static_field_count = 0;
ret->vtable = NULL;
ret->otable_syms = NULL;
ret->atable = NULL;
ret->atable_syms = NULL;
ret->interfaces = NULL;
ret->loader = NULL;
ret->interface_count = 0;
@ -549,6 +552,7 @@ _Jv_InitNewClassFields (jclass ret)
ret->idt = NULL;
ret->arrayclass = NULL;
ret->protectionDomain = NULL;
ret->signers = NULL;
ret->chain = NULL;
}