G++ knowledge of multiple-inheritance class
Joe Buck
jbuck@synopsys.com
Tue Oct 6 22:02:00 GMT 1998
> Is there any way for a GCC port to know that a function call is to
> a multiple-inheritance class? More specifically, know that a call through
> a virtual function table will be to a thunk (assuming thunks are enabled)
> as opposed to any other indirect call through a pointer? With this
> knowledge, AIX thunk calls could be much more efficient.
Mike Stump answered "not without complex link-time feedback", which
certainly seems to be the right answer. Generally, if you can tell it is
a thunk, you can tell the exact function called and can replace the
indirect call with a direct call that bypasses the virtual function table.
Just the same, multiple inheritance isn't that common in C++ code, so I
don't think it's worth expending a lot of effort making it faster; just
make it correct. The biggest C++ wins are going to come from reducing
the abstraction penalty.
More information about the Gcc
mailing list