Real changes for construction vtables (ignore prior mail)

Jim Dehnert dehnert at baalbek.engr.sgi.com
Tue Mar 21 22:55:08 UTC 2000


> From coleen at zko.dec.com  Mon Mar 20 07:24:17 2000
> 
> Jim Dehnert wrote:
> > 
> > I've been working through this proposal, and I think I've noticed an
> > implication that is important.  If the construction vtable groups are
> > not replicas (in layout, not value) of the corresponding complete object
> > vtable groups, eliding the "boring" base class vtables, this affects
> > more than just constructors.  It affects any vtable references in any
> > functions which might be called from constructors, in that they may no
> > longer assume fixed order and offsets of the secondary vtables, and
> > therefore may not use the optimization of using one vtable pointer to
> > access all of them -- instead, they must always load the vtable pointer
> > for the particular subobject whose vtable they are referencing.
> > 
> > Am I interpreting this correctly?
> 
> Yes, that is correct.  I thought this optimization was invalidated by
> something else already - sharing primary virtual tables, wasn't it?
> Because primary vtables may be larger than expected by base classes
> in more derived classes.

Yes, that invalidates sharing the primary vptr with the secondary
vptrs, but it is still possible to use only one secondary vptr, no
matter how many (non-virtual) bases there are.

> But if it wasn't, this would be a tradeoff.

So it is a tradeoff...

Jim

-	    Jim Dehnert		dehnert at sgi.com
				(650)933-4272




More information about the cxx-abi-dev mailing list