diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-08-17 20:44:10 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-08-17 20:44:10 +0000 |
commit | 7dd5e78f772f55f8eca4d242fa8cabce1eaeff50 (patch) | |
tree | 3d74be0649ef589d515a0e04062b5e30115e5b80 /libjava | |
parent | 7d1898d9b959cd870bab208722fbb5f0a67a7598 (diff) | |
download | gcc-7dd5e78f772f55f8eca4d242fa8cabce1eaeff50.tar.gz |
gcc/java:
* class.c (make_class_data): Always emit JV_STATE_PRELOADING for
class' initial state.
libjava:
* java/lang/Class.h (_Jv_IsBinaryCompatibilityABI): Declare as
friend.
* include/jvm.h (_Jv_IsBinaryCompatibilityABI): New function.
* testsuite/libjava.lang/bclink.java: New file.
* testsuite/libjava.lang/bclink.out: New file.
* link.cc (print_class_loaded): Changed ABI test to look at
various _syms fields.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103225 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 10 | ||||
-rw-r--r-- | libjava/include/jvm.h | 9 | ||||
-rw-r--r-- | libjava/java/lang/Class.h | 2 | ||||
-rw-r--r-- | libjava/link.cc | 3 | ||||
-rw-r--r-- | libjava/testsuite/libjava.lang/bclink.java | 12 | ||||
-rw-r--r-- | libjava/testsuite/libjava.lang/bclink.out | 0 |
6 files changed, 34 insertions, 2 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 47e37183074..915c2ff8958 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,13 @@ +2005-08-17 Tom Tromey <tromey@redhat.com> + + * java/lang/Class.h (_Jv_IsBinaryCompatibilityABI): Declare as + friend. + * include/jvm.h (_Jv_IsBinaryCompatibilityABI): New function. + * testsuite/libjava.lang/bclink.java: New file. + * testsuite/libjava.lang/bclink.out: New file. + * link.cc (print_class_loaded): Changed ABI test to look at + various _syms fields. + 2005-08-17 Andreas Tobler <a.tobler@schweiz.ch> * testsuite/libjava.jacks/jacks.xfail: Remove 15.21-assoc-7, diff --git a/libjava/include/jvm.h b/libjava/include/jvm.h index 606a84ddcbf..459d4594278 100644 --- a/libjava/include/jvm.h +++ b/libjava/include/jvm.h @@ -621,4 +621,13 @@ _Jv_IsInterpretedClass (jclass c) return (c->accflags & java::lang::reflect::Modifier::INTERPRETED) != 0; } +// Return true if the class was compiled with the BC ABI. +extern inline jboolean +_Jv_IsBinaryCompatibilityABI (jclass c) +{ + // There isn't really a better test for the ABI type at this point, + // that will work once the class has been registered. + return c->otable_syms || c->atable_syms || c->itable_syms; +} + #endif /* __JAVA_JVM_H__ */ diff --git a/libjava/java/lang/Class.h b/libjava/java/lang/Class.h index 01a653e5c9f..a2ec357f770 100644 --- a/libjava/java/lang/Class.h +++ b/libjava/java/lang/Class.h @@ -235,6 +235,7 @@ jboolean _Jv_CheckAccess (jclass self_klass, jclass other_klass, jclass _Jv_GetArrayClass (jclass klass, java::lang::ClassLoader *loader); jboolean _Jv_IsInterpretedClass (jclass); +jboolean _Jv_IsBinaryCompatibilityABI (jclass); void _Jv_CopyClassesToSystemLoader (java::lang::ClassLoader *); @@ -470,6 +471,7 @@ private: java::lang::ClassLoader *loader); friend jboolean (::_Jv_IsInterpretedClass) (jclass); + friend jboolean (::_Jv_IsBinaryCompatibilityABI) (jclass); #ifdef INTERPRETER friend void ::_Jv_InitField (jobject, jclass, int); diff --git a/libjava/link.cc b/libjava/link.cc index e97b31bb78e..5411f4aacca 100644 --- a/libjava/link.cc +++ b/libjava/link.cc @@ -1659,11 +1659,10 @@ _Jv_Linker::print_class_loaded (jclass klass) if (codesource == NULL) codesource = "<no code source>"; - // We use a somewhat bogus test for the ABI here. char *abi; if (_Jv_IsInterpretedClass (klass)) abi = "bytecode"; - else if (klass->state == JV_STATE_PRELOADING) + else if (_Jv_IsBinaryCompatibilityABI (klass)) abi = "BC-compiled"; else abi = "pre-compiled"; diff --git a/libjava/testsuite/libjava.lang/bclink.java b/libjava/testsuite/libjava.lang/bclink.java new file mode 100644 index 00000000000..b10c678e123 --- /dev/null +++ b/libjava/testsuite/libjava.lang/bclink.java @@ -0,0 +1,12 @@ +// This tests that a C++ ABI class can derive from a BC ABI class. +// This can't always work, but if the base class does not change then +// it will work fine. + +import org.xml.sax.*; + +public class bclink extends SAXParseException { + public bclink() { super ("hi", null); } + + public static void main(String[] args) throws Throwable { + } +} diff --git a/libjava/testsuite/libjava.lang/bclink.out b/libjava/testsuite/libjava.lang/bclink.out new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/libjava/testsuite/libjava.lang/bclink.out |