This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH: java: suppress java.lang.Object constructor


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]