This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gcjx] Patch: FYI: vtable layout fix
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 30 Jan 2005 18:12:09 -0700
- Subject: [gcjx] Patch: FYI: vtable layout fix
- Reply-to: tromey at redhat dot com
I'm checking this in on the gcjx branch.
I forgot that constructors and private methods don't belong in the
vtable.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* aot/aotclass.cc (lay_out_vtable): Skip constructors and private
methods.
Index: aot/aotclass.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcjx/aot/Attic/aotclass.cc,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 aotclass.cc
--- aot/aotclass.cc 31 Jan 2005 00:53:51 -0000 1.1.2.2
+++ aot/aotclass.cc 31 Jan 2005 01:09:22 -0000
@@ -47,7 +47,13 @@
i != klass->end_all_methods ();
++i)
{
- if ((*i)->static_p ())
+ // Static methods, private methods, and constructors do not
+ // appear in the vtable. Note that final methods must appear
+ // there, because they can be called using the vtable via
+ // reflection.
+ if ((*i)->static_p ()
+ || (*i)->constructor_p ()
+ || ((*i)->get_modifiers () & ACC_PRIVATE) != 0)
continue;
model_class *declaring_class = (*i)->get_declaring_class ();