This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: FAQ Update
>>>>> "Jeff" == Jeff Sturm <jsturm@sigma6.com> writes:
Jeff> Are you using Alexandre's DECL_INLINE patches? I saw this
Jeff> too... I worked around it by marking a few particular methods
Jeff> `final' instead of `private'... they are still inlined but not
Jeff> optimized away.
This is a problem. In some cases we have native methods that use
private fields (or methods) in other packages -- so even a heuristic
like "don't remove an unused private method if there is a native
method" won't work right now. (Probably we should change the code and
still use this heuristic, but I haven't really thought about it.)
Jeff> among them that jc1 can't inline native code and vice-versa.
In some cases g++ can inline Java code. That's because gcjh makes an
attempt to decompile certain simple methods. See decompile_method()
in gjavah.c. We could do more here. We could even do full
decompilation if we really wanted.
I agree it would be cooler if g++ and gcj could read each others' code
and really inline. I doubt that will happen.
Tom