PATCH: java: suppress java.lang.Object constructor
Jeff Sturm
jsturm@one-point.com
Tue Jul 17 18:48:00 GMT 2001
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).
Jeff
More information about the Java-patches
mailing list