This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Why do we emit vtables for abstract classes?
- From: Andrew Haley <aph at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: David Daney <ddaney at avtrex dot com>, java at gcc dot gnu dot org
- Date: Mon, 13 Mar 2006 14:31:21 +0000
- Subject: Re: Why do we emit vtables for abstract classes?
- References: <4413A07E.6030104@avtrex.com> <m3wtezuw24.fsf@localhost.localdomain>
Tom Tromey writes:
> >>>>> "David" == David Daney <ddaney@avtrex.com> writes:
>
> David> I am looking at the assembly output of jc1 (recent svn trunk) and am
> David> wondering why there are vtables for abstract classes.
>
> David> There can never be an instance of an abstract class, so we should
> David> never have to access its vtable.
>
> David> Am I missing something, or is the vtable unneeded?
>
> I have a vague memory that we changed to do this on purpose. And
> there is a comment in link.cc about this... but all I can remember
> right now is that we must lay out a vtable for an abstract class (so
> that all the subclasses agree on the layout), not that we must
> actually have the vtable available. (The layout info is available in
> the 'methods' table.)
Yes; something to do with Miranda methods? We need the methods table,
but maybe not the vtable.
Andrew.