This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: C++ PATCH: Emit more thunks




--On Friday, October 25, 2002 01:24:51 PM -0700 Richard Henderson <rth@redhat.com> wrote:

On Fri, Oct 25, 2002 at 12:36:41PM -0700, Mark Mitchell wrote:
The C++ ABI says that you're supposed to all the thunks anyone might
ever need with the function to which you're transferring control.
Really?  So if a method is instantiated in multiple places,
all thunks to that method must be instantiated as well?
Yes.

So the thunk should _always_ be branching to a label in the
same unit of translation?
Yes.  The new thunk mechanism was really designed to be implemented
with alternate entry points; ideally you would just fall through to
the main function, much of the time.  Besides the relocation benefits
you mention, you should also get better locality, and, often,
eliminate the jump at the end of the thunk.

In fact, on IPF, if you have a thunk that adjusts by eight, and
another by sixteen, you ideally have the sixteen thunk adjust by
eight and fall into the eight thunk, which adjusts by eight, and
falls into the main function, without any jumps at all.

Something to do one of these days.

--
Mark Mitchell                mark@codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com


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