This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[BC] Patch: FYI: linking -vs- verification
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 05 Nov 2004 20:43:44 -0700
- Subject: [BC] Patch: FYI: linking -vs- verification
- Reply-to: tromey at redhat dot com
I'm checking this in on the BC branch.
Before handling an entry in the verification table, we must ensure
that the classes in question have their supers installed. Also, since
we don't link an array's component type when we "link" the array type
(array types are completely linked at creation time), and since we
don't link in _Jv_IsAssignableFromSlow, we must strip array classes in
the verifier.
Stripping the arrays is arguably wrong; anyway it is more efficient
to do this in the compiler.
With this patch Eclipse 3 gets back to the mysterious hang I was
seeing yesterday. I didn't notice then, but it does manage to draw
some widgets before it gets wedged.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* link.cc (verify_type_assertions): Ensure classes have supers
linked. Strip off array types first.
Index: link.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Attic/link.cc,v
retrieving revision 1.1.2.10
diff -u -r1.1.2.10 link.cc
--- link.cc 5 Nov 2004 19:30:11 -0000 1.1.2.10
+++ link.cc 6 Nov 2004 03:39:31 -0000
@@ -1632,6 +1632,17 @@
if (cl1 == NULL || cl2 == NULL)
continue;
+ // Strip off array types before trying to link supers. This
+ // is somewhat ugly, since it duplicates some logic from
+ // _Jv_IsAssignableFromSlow.
+ while (cl1->isArray () && cl2->isArray ())
+ {
+ cl1 = cl1->getComponentType ();
+ cl2 = cl2->getComponentType ();
+ }
+ wait_for_state (cl1, JV_STATE_LOADING);
+ wait_for_state (cl2, JV_STATE_LOADING);
+
if (! _Jv_IsAssignableFromSlow (cl2, cl1))
{
jstring s = JvNewStringUTF ("Incompatible types: In class ");