This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: gcj executable size reduction?
- From: Per Bothner <per at bothner dot com>
- To: Adam Megacz <megacz at gcc dot gnu dot org>
- Cc: java at gcc dot gnu dot org
- Date: Tue, 04 May 2004 11:22:24 -0700
- Subject: Re: gcj executable size reduction?
- References: <407EABEF.7010208@bothner.com> <407EB605.3070402@avtrex.com> <407EB8C3.5060205@avtrex.com> <16510.47960.352311.839928@cuddles.cambridge.redhat.com> <4080310B.9030204@redhat.com> <m1smegpu0w.fsf@nowhere.com>
Adam Megacz wrote:
The way it works is this: you compile all your code into bytecode, it
traces reachability (including symbol tables in any CNI code) and
stubs out unreachable method with a one-line "throw new
UnsatisfiedLinkError()". There are a few more optimizations, but
that's the main gist.
I'll look at this more closely. Does this also optimize libgcj?
The other change I made was to add -finhibit-reflection, which drops
as much reflection metadata as possible. Class.forName() still works
and I keep enough method info to use interface dispatch (although I'd
love to do that differently).
Do you have a patch for this? Is this something that would/should be
added to the source tree?
Any luck, Per?
I've added a -verbose:class to print out initializations,
plus a -lgij to enable compiling a static executable.
But the pieces aren't all together yet.
--
--Per Bothner
per@bothner.com http://per.bothner.com/