PATCH: java: suppress java.lang.Object constructor
Tom Tromey
tromey@redhat.com
Tue Jul 17 17:15:00 GMT 2001
>>>>> "Jeff" == Jeff Sturm <jsturm@one-point.com> writes:
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?
If the superclass is derived from Object and it doesn't need a
constructor, then eliminate more calls? (i.e., work recursively)
Jeff> (Note that someday when gcj has a real inliner this special case
Jeff> should be unnecessary.)
Yeah.
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...
Tom
More information about the Java-patches
mailing list