Re: use of vtbl

"Martin v. =?iso-8859-1?q?L=F6wis?=" <loewis@informatik.hu-berlin.de>
14 Aug 2002 02:16:55 -0400

          From comp.compilers

Related articles
use of vtbl Michael.Bantle@t-systems.de (Michael BANTLE) (2001-08-06)
Re: use of vtbl fjh@cs.mu.OZ.AU (2001-08-08)
Re: use of vtbl zoicasc@hotmail.com (Cristian Zoicas) (2002-08-04)
Re: use of vtbl gdr@soliton.integrable-solutions.net (Gabriel Dos Reis) (2002-08-10)
Re: use of vtbl mal@wyrd.be (Lieven Marchand) (2002-08-10)
Re: use of vtbl bill@gibbons.org (Bill Gibbons) (2002-08-10)
Re: use of vtbl haberg@matematik.su.se (Hans Aberg) (2002-08-14)
Re: use of vtbl loewis@informatik.hu-berlin.de (Martin v. =?iso-8859-1?q?L=F6wis?=) (2002-08-14)
| List of all articles for this month |

From: "Martin v. =?iso-8859-1?q?L=F6wis?=" <loewis@informatik.hu-berlin.de>
Newsgroups: comp.compilers
Date: 14 Aug 2002 02:16:55 -0400
Organization: Humboldt University Berlin, Department of Computer Science
References: 01-08-021 02-08-018 02-08-023
Keywords: C++
Posted-Date: 14 Aug 2002 02:16:55 EDT

"Lieven Marchand" <mal@wyrd.be> writes:


> In some implementations this is done by keeping a table of offsets
> in the vtbl, in others it's done by letting the function in the
> table be a trampoline that adjusts the this pointer before jumping
> to the real function.


There are many more issues to consider:


- how do you represent RTTI, in particular:
    - at what slot do you put RTTI (typically -1 or 0)?
    - does that slot indicate a function or a typeinfo pointer?


- how do you represent covariant return types?


- how do you represent function pointers? The typical solution is to
    take the address of the function. This is a problem for
    position-independent code, though, as that address may be known only
    at run-time, so the dynamic loader would have to fix all vtables.


- where do you put the implicit virtual destructor?


- is there any virtual deallocation function (not mandated by
    standard, but MSVC adds a slot for that, anyway)


- how do you represent virtual bases?


There are probably more issues.


Regards,
Martin


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.