This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: class initialization check overhead
- From: Andrew Haley <aph at redhat dot com>
- To: Jeff Sturm <jsturm at one-point dot com>
- Cc: Tom Tromey <tromey at redhat dot com>, Adam Megacz <adam at megacz dot com>,<java at gcc dot gnu dot org>
- Date: Sun, 15 Dec 2002 13:06:17 +0000 (GMT)
- Subject: Re: class initialization check overhead
- References: <87znrw283n.fsf@fleche.redhat.com><Pine.LNX.4.44.0212141347370.22899-100000@ops2.one-point.com>
Jeff Sturm writes:
> On 25 Nov 2002, Tom Tromey wrote:
> > Jeff> Come to think of it... what if compiled classes were prepared
> > Jeff> early instead of at initialization time? In my application of
> > Jeff> 191 classes, only 36 have a <clinit>. If the frontend knows
> > Jeff> that a class invokes no <clinit> method (directly or in a
> > Jeff> superclass), could the _Jv_InitClass be dropped entirely?
> >
> > Yes, with caveats.
> >
> > I think there are two cases to consider.
> >
> > First, the general case. Once we have the full binary compatibility
> > code in place, we won't be able to omit class initialization calls.
>
> I agree. For full binary compatibility, I'd eventually like
> -fno-assume-compiled and -findirect-dispatch to work together. Entire
> packages could be compiled to native code with direct references to
> classes in the same package, while assuming nothing about other packages.
>
> I think that could yield a good compromise of optimization and
> compatibility.
Absolutely right. Sorry to post a "me too" message, but this is the
way I've been thinking gcj should go.
Andrew.