C++ PATCH: Key methods for ARM EABI
Mark Mitchell
mark@codesourcery.com
Wed Sep 1 03:28:00 GMT 2004
Gabriel Dos Reis wrote:
>Mark Mitchell <mark@codesourcery.com> writes:
>
>| The ARM EABI has an optimization to the standard Itanium C++ ABI key
>| method rules: an inline function is never chosen as the key method.
>| In the Itanium C++ ABI, the key method is the first virtual, non-pure
>| function that is not inline *at the point of class definition*. The
>| difference comes up for classes like:
>|
>| class C { virtual void f(); };
>| inline void C::f() {} // Itanium key method, but not ARM key method
>|
>| The Itanium C++ ABI committee was concerned that C::f would be defined
>| in some translation units, but not others, with the result that there
>| would be no definition emitted for C's vtable. But, technically, the
>| standard prevents that ("An inline function shall be defined in every
>| translation unit in which it is used" and "A virtual member function
>| is used if it is not pure") so ARM is optimizing by not emitting the
>| vtable in so many places.
>
>Many thanks for having choosen to optimize for this construct!
>
>Are we going to have a new version of Itanium C++ ABI with more
>optimizations for abstractions?
>
>
I doubt it.
I think most people hope to leave the ABI alone basically forever.
There's certainly no active effort; the committee has disbanded.
ARM decided that it was worth it to them to be different, even though
that means changes for compilers that target their architecture. They
were doing a whole new ABI from scratch, so there was no compatibility
issue for them. Maybe other new architectures will want to take
advantage of some of the same ideas.
--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com
More information about the Gcc-patches
mailing list