This is the mail archive of the java@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: gcj executable size reduction?


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


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