diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-10-09 16:24:55 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-10-09 16:24:55 +0000 |
commit | 2dc14c9e6b2bec610b66b59bb2431c87bf71dd5c (patch) | |
tree | 727452210eb531de02f4fcf33d696da39148dbce /libjava | |
parent | 494cf68ef601c6578e1224d70a4a8750a416003c (diff) | |
download | gcc-2dc14c9e6b2bec610b66b59bb2431c87bf71dd5c.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72271 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 13 | ||||
-rw-r--r-- | libjava/boehm.cc | 2 | ||||
-rw-r--r-- | libjava/java/lang/Class.h | 3 | ||||
-rw-r--r-- | libjava/java/lang/Class.java | 7 | ||||
-rw-r--r-- | libjava/java/lang/ClassLoader.java | 2 | ||||
-rw-r--r-- | libjava/java/lang/natClass.cc | 12 | ||||
-rw-r--r-- | libjava/java/lang/natClassLoader.cc | 4 |
7 files changed, 37 insertions, 6 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 4a65d1148fa..0c6ec096682 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -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: diff --git a/libjava/boehm.cc b/libjava/boehm.cc index af5f979197d..73240885510 100644 --- a/libjava/boehm.cc +++ b/libjava/boehm.cc @@ -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)) diff --git a/libjava/java/lang/Class.h b/libjava/java/lang/Class.h index 7572c6cfdb2..5cf6e2c0ce3 100644 --- a/libjava/java/lang/Class.h +++ b/libjava/java/lang/Class.h @@ -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; }; diff --git a/libjava/java/lang/Class.java b/libjava/java/lang/Class.java index 86d52be4b87..6fd4ff07d48 100644 --- a/libjava/java/lang/Class.java +++ b/libjava/java/lang/Class.java @@ -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 (); diff --git a/libjava/java/lang/ClassLoader.java b/libjava/java/lang/ClassLoader.java index 103976758d7..7bbd6412554 100644 --- a/libjava/java/lang/ClassLoader.java +++ b/libjava/java/lang/ClassLoader.java @@ -502,7 +502,7 @@ public abstract class ClassLoader */ protected final void setSigners(Class c, Object[] signers) { - // c.setSigners(signers); + c.setSigners(signers); } /** diff --git a/libjava/java/lang/natClass.cc b/libjava/java/lang/natClass.cc index aa5867fc871..4c71ed1cea0 100644 --- a/libjava/java/lang/natClass.cc +++ b/libjava/java/lang/natClass.cc @@ -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 diff --git a/libjava/java/lang/natClassLoader.cc b/libjava/java/lang/natClassLoader.cc index e3519f33c5b..10b4bc64e23 100644 --- a/libjava/java/lang/natClassLoader.cc +++ b/libjava/java/lang/natClassLoader.cc @@ -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; } |