This is the mail archive of the
mailing list for the GCC project.
Re: PATCH: java: suppress java.lang.Object constructor
- To: Tom Tromey <tromey at redhat dot com>
- Subject: Re: PATCH: java: suppress java.lang.Object constructor
- From: Jeff Sturm <jsturm at one-point dot com>
- Date: Tue, 17 Jul 2001 21:47:51 -0400 (EDT)
- cc: java-patches at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
On 17 Jul 2001, Tom Tromey wrote:
> Jeff> This patch prevents adding the implicit call to super's
> Jeff> constructor in classes derived from java.lang.Object. It's a
> Jeff> simple and straightforward optimization since java.lang.Object's
> Jeff> constructor is an empty function.
> Is it hard to do this in a general way?
Perhaps not. For classes loaded from bytecode however, checking for the
existence of <init> isn't sufficient. (If one is going to go to the
trouble, might as well write a tree inliner...)
> Another idea in this same area is to change what `new' does depending
> on whether the class has a finalizer. We could even inline the class
> init call and then directly call into the GC for allocation when there
> is no finalizer. Hans has mentioned this as a win several times. In
> case you're interested...
That sounds good. I see a disproportionate number of cache misses in
_Jv_AllocObject, ostensibly due to the finalizer check (java.lang.Object's
vtable is seldom used otherwise).