cross-module inlining (was Re: using gcj for a different language - is it possible?)

Jeff Sturm jsturm@one-point.com
Mon Feb 9 04:18:00 GMT 2004


On 8 Jan 2004, Tom Tromey wrote:
> Offhand I don't remember what sort of inlining we can do. We're sort
> of moving away from doing inlining by default, since that breaks
> binary compatibility. But, yes, if the user asks for it, gcj will
> inline methods, hopefully even across class boundaries.

I've been thinking a little about this since it can restrict inlining,
escape analysis, and any other sort of useful IPA gcj might perform.
C/C++ have a related problem that public functions cannot normally be
inlined into library code because they may be overriden by the dynamic
linker at runtime. This inlining is controlled by the binds_local_p
target hook. The default hook checks flag_pic to determine if it is
compiling a shared library or not.
Similarly in Java, why not leave the most aggressive optimizations for the
main executable (non-PIC) and stick to conservative binary-compatible
optimizations for libraries? Does binary compatibility really matter for
non-library code?
If not, maybe there is no need for a special flag.
Jeff


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /