Re: use of vtbl

"Martin v. =?iso-8859-1?q?L=F6wis?=" <>
14 Aug 2002 02:16:55 -0400

          From comp.compilers

Related articles
use of vtbl (Michael BANTLE) (2001-08-06)
Re: use of vtbl (2001-08-08)
Re: use of vtbl (Cristian Zoicas) (2002-08-04)
Re: use of vtbl (Gabriel Dos Reis) (2002-08-10)
Re: use of vtbl (Lieven Marchand) (2002-08-10)
Re: use of vtbl (Bill Gibbons) (2002-08-10)
Re: use of vtbl (Hans Aberg) (2002-08-14)
Re: use of vtbl (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?=" <>
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" <> 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.


Post a followup to this message

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