This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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: Disable sibcalls for all targets


Andrew Pinski writes:
 > 
 > On Monday, May 19, 2003, at 11:32 US/Eastern, Andrew Haley wrote:
 > 
 > > Andrew Pinski writes:
 > >>
 > >>
 > >> sibcall optimization usually speeds up many programs and makes them
 > >> smaller (in fact on ppc, if there is only one call at the end, it
 > >> does not have to save the link register at all, so it can speed up
 > >> considerably on the 750/7400/7500 series because they mflr and mtlr
 > >> and serializing instructions because lr is not renamed).
 > >>
 > >> In fact I think Java is faulty if depends on what is in the
 > >> backtrace but that is a different argument.
 > >
 > > How is that a different argument?  We have to disallow all
 > > optimizations that don't conform to the language specification.
 > > That's the same for C and Java and any other language.
 > 
 > No I was trying to say that is Java was written wrong in first place.
 > Not that the patch is not needed.
 > 
 > What about this, if it is gnu.* and java.* disable sibcall optimizations
 > (that need it, if all need it then do that) in libjava,
 > and write in the documentation about this bug (feature).

No, it's needed whenever code that will be loaded by one class loader
calls into code that will be loaded by another class loader.  At
compiler time AFAIK we have know way to know what class loader will be
used.  

I think we can build libgcj with sibcall optimization because we know
that all of libgcj will be loaded by the system class loader, but for
users' classes we have no such knowledge, and therefore any calls to
methods outside the current class may not be sibcalls.

Andrew.


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