This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: gcj executable size reduction?
- From: Adam Megacz <adam at megacz dot com>
- To: Per Bothner <per at bothner dot com>
- Cc: Adam Megacz <megacz at gcc dot gnu dot org>, java at gcc dot gnu dot org
- Date: Tue, 04 May 2004 18:08:00 -0700
- Subject: Re: gcj executable size reduction?
- Organization: Myself
- 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><4097DF60.7090002@bothner.com>
Per Bothner <per@bothner.com> writes:
>> 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?
Yes; that's where most of the gain comes from. It starts from
libgcj-3.3.jar.
>> 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?
http://core.ibex.org/upstream/gcc-3.3/patches/zzz-inhibit.reflection.patch
I need to catch up with the gcc dev at some point, but if people are
cool with the general idea, I'll take the time to integrate it.
> I've added a -verbose:class to print out initializations,
Ah, that's nice. We could definately feed that back into NanoGoat.
> plus a -lgij to enable compiling a static executable.
Hrm, I don't understand what this does. I just leave the interpreter
out altogether.
- a