EGCS: pointer to member functions.
Mike Stump
mrs@wrs.com
Tue Jun 15 07:45:00 GMT 1999
> From: Alexandre Oliva <oliva@dcc.unicamp.br>
> Date: 15 Jun 1999 03:54:56 -0300
> On Jun 15, 1999, Brendan Simon <brendan@dgs.monash.edu.au> wrote:
> > Why is there so much overhead in calling a function via a pointer as
> > apposed to calling it directly?
> Pointer-to-methods don't know whether they point to virtual methods or
> not, so the caller must have code for both cases. Methinks this could
> be improved by generating thunks that perform dynamic binding in the
> case of invoking virtual methods, but maybe I'm missing something.
Try it, lay it out, read up on C++ and what is required of the
generated code. :-) I have, I think. :-) Hint, there is no separate
type for pointer to virtual method and pointer to non-virtual member.
Now, complete program analysis and code complete generation at link
time trivially solves this problem. This means that one could put the
info into the repo file, and just call a recompile pass for any files
that then don't meet the flexibility requirements.
But, I whimped out and did it the easy way.
More information about the Gcc
mailing list