class.c (make_class_data): Always emit JV_STATE_PRELOADING for class' initial state.
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. From-SVN: r103225
This commit is contained in:
parent
87bb8864f6
commit
97b51fd08e
8 changed files with 42 additions and 9 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2005-08-16 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
|
* class.c (make_class_data): Always emit JV_STATE_PRELOADING for
|
||||||
|
class' initial state.
|
||||||
|
|
||||||
2005-08-16 Ranjit Mathew <rmathew@hotmail.com>
|
2005-08-16 Ranjit Mathew <rmathew@hotmail.com>
|
||||||
|
|
||||||
PR java/22113
|
PR java/22113
|
||||||
|
|
|
@ -1860,13 +1860,9 @@ make_class_data (tree type)
|
||||||
PUSH_FIELD_VALUE (cons, "loader", null_pointer_node);
|
PUSH_FIELD_VALUE (cons, "loader", null_pointer_node);
|
||||||
PUSH_FIELD_VALUE (cons, "interface_count",
|
PUSH_FIELD_VALUE (cons, "interface_count",
|
||||||
build_int_cst (NULL_TREE, interface_len));
|
build_int_cst (NULL_TREE, interface_len));
|
||||||
PUSH_FIELD_VALUE
|
PUSH_FIELD_VALUE (cons, "state",
|
||||||
(cons, "state",
|
convert (byte_type_node,
|
||||||
convert (byte_type_node,
|
build_int_cst (NULL_TREE, JV_STATE_PRELOADING)));
|
||||||
build_int_cst (NULL_TREE,
|
|
||||||
flag_indirect_dispatch
|
|
||||||
? JV_STATE_PRELOADING
|
|
||||||
: JV_STATE_COMPILED)));
|
|
||||||
|
|
||||||
PUSH_FIELD_VALUE (cons, "thread", null_pointer_node);
|
PUSH_FIELD_VALUE (cons, "thread", null_pointer_node);
|
||||||
PUSH_FIELD_VALUE (cons, "depth", integer_zero_node);
|
PUSH_FIELD_VALUE (cons, "depth", integer_zero_node);
|
||||||
|
|
|
@ -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>
|
2005-08-17 Andreas Tobler <a.tobler@schweiz.ch>
|
||||||
|
|
||||||
* testsuite/libjava.jacks/jacks.xfail: Remove 15.21-assoc-7,
|
* testsuite/libjava.jacks/jacks.xfail: Remove 15.21-assoc-7,
|
||||||
|
|
|
@ -621,4 +621,13 @@ _Jv_IsInterpretedClass (jclass c)
|
||||||
return (c->accflags & java::lang::reflect::Modifier::INTERPRETED) != 0;
|
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__ */
|
#endif /* __JAVA_JVM_H__ */
|
||||||
|
|
|
@ -235,6 +235,7 @@ jboolean _Jv_CheckAccess (jclass self_klass, jclass other_klass,
|
||||||
jclass _Jv_GetArrayClass (jclass klass, java::lang::ClassLoader *loader);
|
jclass _Jv_GetArrayClass (jclass klass, java::lang::ClassLoader *loader);
|
||||||
|
|
||||||
jboolean _Jv_IsInterpretedClass (jclass);
|
jboolean _Jv_IsInterpretedClass (jclass);
|
||||||
|
jboolean _Jv_IsBinaryCompatibilityABI (jclass);
|
||||||
|
|
||||||
void _Jv_CopyClassesToSystemLoader (java::lang::ClassLoader *);
|
void _Jv_CopyClassesToSystemLoader (java::lang::ClassLoader *);
|
||||||
|
|
||||||
|
@ -470,6 +471,7 @@ private:
|
||||||
java::lang::ClassLoader *loader);
|
java::lang::ClassLoader *loader);
|
||||||
|
|
||||||
friend jboolean (::_Jv_IsInterpretedClass) (jclass);
|
friend jboolean (::_Jv_IsInterpretedClass) (jclass);
|
||||||
|
friend jboolean (::_Jv_IsBinaryCompatibilityABI) (jclass);
|
||||||
|
|
||||||
#ifdef INTERPRETER
|
#ifdef INTERPRETER
|
||||||
friend void ::_Jv_InitField (jobject, jclass, int);
|
friend void ::_Jv_InitField (jobject, jclass, int);
|
||||||
|
|
|
@ -1659,11 +1659,10 @@ _Jv_Linker::print_class_loaded (jclass klass)
|
||||||
if (codesource == NULL)
|
if (codesource == NULL)
|
||||||
codesource = "<no code source>";
|
codesource = "<no code source>";
|
||||||
|
|
||||||
// We use a somewhat bogus test for the ABI here.
|
|
||||||
char *abi;
|
char *abi;
|
||||||
if (_Jv_IsInterpretedClass (klass))
|
if (_Jv_IsInterpretedClass (klass))
|
||||||
abi = "bytecode";
|
abi = "bytecode";
|
||||||
else if (klass->state == JV_STATE_PRELOADING)
|
else if (_Jv_IsBinaryCompatibilityABI (klass))
|
||||||
abi = "BC-compiled";
|
abi = "BC-compiled";
|
||||||
else
|
else
|
||||||
abi = "pre-compiled";
|
abi = "pre-compiled";
|
||||||
|
|
12
libjava/testsuite/libjava.lang/bclink.java
Normal file
12
libjava/testsuite/libjava.lang/bclink.java
Normal file
|
@ -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 {
|
||||||
|
}
|
||||||
|
}
|
0
libjava/testsuite/libjava.lang/bclink.out
Normal file
0
libjava/testsuite/libjava.lang/bclink.out
Normal file
Loading…
Add table
Add a link
Reference in a new issue