This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH: Emit more thunks
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 25 Oct 2002 13:29:26 -0700
- Subject: 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