This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: layout of the g++ virtual tables



 | All you need do, is dispatch as you did before, just remove the this
 | offset code, and change the vtable entry size from 8 to 4.

Thank you. It confirms what I was inclined to think from what
information I could gather myself.

 | 
 | I hope you don't mind me copying egcs on this, but I thought I would
 | so that if others that want to comment can have a chance and I didn't
 | think you would mind.  Also, people can correct me if I get anything
 | wrong, and people can fill in any gaps, if I miss a few, and so that
 | others may read an understand a bit more, if they want.
 | 

That's fine with me.


 | In fact, some ports (linux for example) already use the `new' scheme
 | by default.  Thunks can be turned on and off on most targets via
 | -fvtable-thunks.  In the compiler, you can know the default by
 | checking DEFAULT_VTABLE_THUNKS, if defined, and if it is true, then
 | the new scheme is in use.  At some point, we will (may) switch this,
 | and have all platforms default the otherway.  I suspect you'll just
 | have to discover this, and readjust your code.
 | 

ooops... not all the ports have moved to the new scheme. Gash, some
more configuration management problems....

 | Ok, now onto the main stuff...

Thank you for your explanation. So basically, since we use the vtables
created on the c++ side, we don't need to care about MI anymore,
everything should be taken care automatically... how convenient!

I was wondering if there was some type specific information stored
along with the virtual table. In GNAT we store plenty of other
information used among other thing to check the validity of the
downcasts or to allow dispatching among partitions (for distributed
systems). Wouldn't the first 2 words be used for something like that
by any chance?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]