public inbox for java-prs@sourceware.org help / color / mirror / Atom feed
* [Bug java/17187] New: Call to java.lang.Object constructor is redundant @ 2004-08-25 15:45 mckinlay at redhat dot com 2004-08-25 15:58 ` [Bug java/17187] " pinskia at gcc dot gnu dot org ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: mckinlay at redhat dot com @ 2004-08-25 15:45 UTC (permalink / raw) To: java-prs The constructor for java.lang.Object does nothing. Its probably a reasonable assumption that it will always do nothing, so, we should change the compiler to not generate calls to it when generating native code. This would save 1 call for every "new" operation, and also improve the number of inlining opportunities available to the compiler, as many constructor calls could now be fully inlined. One way to do this might be to extend the java "builtins" mechanism to allow us to turn other well known calls, not just Math.* calls, into inlined trees. If we see a java.lang.Object() call, check_for_builtin() would just return an empty statement tree. -- Summary: Call to java.lang.Object constructor is redundant Product: gcc Version: 3.5.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P2 Component: java AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mckinlay at redhat dot com CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17187 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug java/17187] Call to java.lang.Object constructor is redundant 2004-08-25 15:45 [Bug java/17187] New: Call to java.lang.Object constructor is redundant mckinlay at redhat dot com @ 2004-08-25 15:58 ` pinskia at gcc dot gnu dot org 2004-08-25 16:16 ` mckinlay at redhat dot com 2004-11-08 2:49 ` pinskia at gcc dot gnu dot org 2 siblings, 0 replies; 4+ messages in thread From: pinskia at gcc dot gnu dot org @ 2004-08-25 15:58 UTC (permalink / raw) To: java-prs ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-08-25 15:58 ------- Confirmed. But I should note that even the Sun's javac does not do this optimization so ... -- What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed| |1 Last reconfirmed|0000-00-00 00:00:00 |2004-08-25 15:58:47 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17187 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug java/17187] Call to java.lang.Object constructor is redundant 2004-08-25 15:45 [Bug java/17187] New: Call to java.lang.Object constructor is redundant mckinlay at redhat dot com 2004-08-25 15:58 ` [Bug java/17187] " pinskia at gcc dot gnu dot org @ 2004-08-25 16:16 ` mckinlay at redhat dot com 2004-11-08 2:49 ` pinskia at gcc dot gnu dot org 2 siblings, 0 replies; 4+ messages in thread From: mckinlay at redhat dot com @ 2004-08-25 16:16 UTC (permalink / raw) To: java-prs ------- Additional Comments From mckinlay at redhat dot com 2004-08-25 16:16 ------- pinskia: bytecode compilation is a different story. Obviously we should only do this when compiling to _native_ code. We know our java.lang.Object constructor doesn't do anything, but we can't make that assumption about other implementations. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17187 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug java/17187] Call to java.lang.Object constructor is redundant 2004-08-25 15:45 [Bug java/17187] New: Call to java.lang.Object constructor is redundant mckinlay at redhat dot com 2004-08-25 15:58 ` [Bug java/17187] " pinskia at gcc dot gnu dot org 2004-08-25 16:16 ` mckinlay at redhat dot com @ 2004-11-08 2:49 ` pinskia at gcc dot gnu dot org 2 siblings, 0 replies; 4+ messages in thread From: pinskia at gcc dot gnu dot org @ 2004-11-08 2:49 UTC (permalink / raw) To: java-prs ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-11-08 02:49 ------- Man this is a semi hard problem, I could figure out where the call expression is built but we patch it up which makes it harder (maybe we should pass a pointer to the tree which we patch up and then change it to a nop). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17187 ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-11-08 2:49 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2004-08-25 15:45 [Bug java/17187] New: Call to java.lang.Object constructor is redundant mckinlay at redhat dot com 2004-08-25 15:58 ` [Bug java/17187] " pinskia at gcc dot gnu dot org 2004-08-25 16:16 ` mckinlay at redhat dot com 2004-11-08 2:49 ` pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).