EGCS: pointer to member functions.

Jason Merrill
Wed Jun 23 00:46:00 GMT 1999

>>>>> Alexandre Oliva <> writes:

 > On Jun 22, 1999, Jason Merrill <> wrote:
 >> I'm really don't think this change is a good idea; going through a thunk
 >> costs more than a simple test.  With branch prediction, the cost of the
 >> test is about zero, while the thunk adds an extra jump.

 > But the thunk would only be used for
 > pointer-to-virtual-member-function.  With the current code, users are
 > paying the price of an additional test and branch even when they only
 > use pointer-to-non-virtual-member-function.

If the class has virtual functions, yes.

 > Moreover, even if the test cost is close to zero, it would still have
 > to branch, and, given that the `thunk' I have in mind is as simple as
 > a `trampoline', I don't see how it could be less efficient than the
 > current approach.  Only if branches with good prediction were much
 > cheaper than a 100% certain jump; is this the case?

So I'm told.  I must admit that I don't really understand the situation


More information about the Gcc mailing list