This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: java: suppress java.lang.Object constructor
- To: Jeff Sturm <jsturm at one-point dot com>
- Subject: Re: PATCH: java: suppress java.lang.Object constructor
- From: Tom Tromey <tromey at redhat dot com>
- Date: 17 Jul 2001 18:39:48 -0600
- Cc: java-patches at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- References: <Pine.LNX.4.10.10107120951120.1741-100000@mars.deadcafe.org>
- Reply-To: tromey at redhat dot com
>>>>> "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