This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: about non-compatible optimization (was: Re: patch to bring java vtables closer to g++ abi conformance)
Andrew Haley wrote:
> The Right Way to solve this problem, IMO, is to have two entry points
> to each method, like this:
>
> bar.foo:
> call InitializeClass (bar)
> bar.foo.alreadyinitialzed:
> ... the rest
>
> And the single level of indirection that we already have for calls
> into shared objects suffices here: we just rewrite the entry in the
> PLT. ...
>
> However, I don't think that gcc has any general-purpose means to do
> this.
Well, I believe C++ uses multiple entry-points for handling
"this" adjustment as needed for multiple inheritance. If we can't
use that, we can always do have bar.foo make a plain call to
bar.foo.alreadyinitialzed. After all there are no variable-sized
argument lists or structures passed by value in Java, so this is
easy. It might produce slightly confusing stack traces, but
that can be fixed.
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/