public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* How does virtual function dispatch work in gcc?
@ 2003-01-17 21:00 Dennis Dams
  2003-01-18  0:49 ` Joe Buck
  0 siblings, 1 reply; 3+ messages in thread
From: Dennis Dams @ 2003-01-17 21:00 UTC (permalink / raw)
  To: gcc

Hi,

Can someone give me (or point me to) an explanation of how the virtual
function dispatch mechanism works in gcc?
thanks,
--Dennis.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How does virtual function dispatch work in gcc?
  2003-01-17 21:00 How does virtual function dispatch work in gcc? Dennis Dams
@ 2003-01-18  0:49 ` Joe Buck
  2003-01-19 23:57   ` Dennis Dams
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Buck @ 2003-01-18  0:49 UTC (permalink / raw)
  To: Dennis Dams; +Cc: gcc

On Fri, Jan 17, 2003 at 01:13:17PM -0500, Dennis Dams wrote:
> Can someone give me (or point me to) an explanation of how the virtual
> function dispatch mechanism works in gcc?
> thanks,

Every compiler I've ever heard of uses a virtual function table (vtable),
and each object that has virtual functions has a pointer to the vtable for
its class.  But I presume that you know that and you'll looking for the
nitty-gritty details.

At least for the ia32 and ia64 platforms, see

http://www.codesourcery.com/cxx-abi/abi.html#vtable

for a complete spec (the document was written for ia64, but ia32 is the
same other than the size of the pointers).


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How does virtual function dispatch work in gcc?
  2003-01-18  0:49 ` Joe Buck
@ 2003-01-19 23:57   ` Dennis Dams
  0 siblings, 0 replies; 3+ messages in thread
From: Dennis Dams @ 2003-01-19 23:57 UTC (permalink / raw)
  To: Joe Buck; +Cc: gcc

Thanks.

I'm trying to understand what I see in gcc's parse tree for C++ programs
with virtual functions.

From reading the documentation you point to, it seems that even at the
parse-tree level, things are highly platform dependent - much more than for
the case of the C parse tree.
Is that correct?

Would you know of any additional documentation which describes these vtable
issues more at the level of the parse tree?

--dennis.


----- Original Message -----
From: "Joe Buck" <jbuck@synopsys.com>
To: "Dennis Dams" <dennis@research.bell-labs.com>
Cc: <gcc@gcc.gnu.org>
Sent: Friday, January 17, 2003 2:15 PM
Subject: Re: How does virtual function dispatch work in gcc?


> On Fri, Jan 17, 2003 at 01:13:17PM -0500, Dennis Dams wrote:
> > Can someone give me (or point me to) an explanation of how the virtual
> > function dispatch mechanism works in gcc?
> > thanks,
>
> Every compiler I've ever heard of uses a virtual function table (vtable),
> and each object that has virtual functions has a pointer to the vtable for
> its class.  But I presume that you know that and you'll looking for the
> nitty-gritty details.
>
> At least for the ia32 and ia64 platforms, see
>
> http://www.codesourcery.com/cxx-abi/abi.html#vtable
>
> for a complete spec (the document was written for ia64, but ia32 is the
> same other than the size of the pointers).
>
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-01-19 20:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-17 21:00 How does virtual function dispatch work in gcc? Dennis Dams
2003-01-18  0:49 ` Joe Buck
2003-01-19 23:57   ` Dennis Dams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).