Re: New Implementation of Virtual Functions in C++

"Jan Gray" <jsgray@acm.org>
23 Nov 1999 13:08:06 -0500

          From comp.compilers

Related articles
New Implementation of Virtual Functions in C++ sjmccaug@prairienet.org (1999-11-18)
Re: New Implementation of Virtual Functions in C++ johnmce@texas.net (1999-11-19)
Re: New Implementation of Virtual Functions in C++ neeri@iis.ee.ethz.ch (Matthias Neeracher) (1999-11-19)
Re: New Implementation of Virtual Functions in C++ landauer@apple.com (1999-11-19)
Re: New Implementation of Virtual Functions in C++ jsgray@acm.org (Jan Gray) (1999-11-23)
| List of all articles for this month |
From: "Jan Gray" <jsgray@acm.org>
Newsgroups: comp.compilers
Date: 23 Nov 1999 13:08:06 -0500
Organization: Compilers Central
References: 99-11-100 99-11-111
Keywords: C++, code, comment

Doug Landauer wrote in message 99-11-111...
>I wouldn't venture to guess whether these are "more common" than the
>cfront-style vtables yet, since I don't know how MS-VC++ does it :-)


See
http://www.geocities.com/SiliconValley/Foothills/7592/oop/Gray-article.html.


VC++ employs so-called adjuster thunks for MI, and it introduced a
mechanism to avoid them most of the time (unless the particular
derived-class member function overrides a virtual function inherited
from more than one base class.)


There are also "vtordisp adjuster thunks" (virtual base class's
construction displacement adjuster thunks) which ensure correct
behavior, during base class construction/destruction, of calls on
overridden virtual functions of virtually inherited base classes.


VC++ also uses "vcall thunks" to help implement pointers to member
functions. A vcall thunk is a deferred virtual function call. These
help to represent, in a single code pointer, which member function to
call and whether to call it virtually or not, and greatly simplify
each pmf call code site.


Sorry if you don't like the terminology.


Jan Gray
[Nice article. Can you get them to stick it in MSDN? -John]


Post a followup to this message

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