From: Andrew Pinski <pinskia@gmail.com>
To: Li junsong <ljs.darkfish@gmail.com>
Cc: java@gcc.gnu.org
Subject: Re: Why does a 'new' statement produce so many temporary variables
Date: Tue, 09 Aug 2011 16:22:00 -0000 [thread overview]
Message-ID: <CA+=Sn1mm-K-CyMH_Je2DFZgALBp-GvqzaL5pthgRSg65RSEhwg@mail.gmail.com> (raw)
In-Reply-To: <CA+kGxtNcCNWxYUs_Bz9a+9ULfy4MHP=JghUVz0_HL7ztL+Pjmw@mail.gmail.com>
On Tue, Aug 9, 2011 at 12:18 AM, Li junsong <ljs.darkfish@gmail.com> wrote:
> 3. I find that there is no document to describe the implementation of
> Java front end.
> I don't understand why we need so many temporary variables:
>
> #ref#2#4 = _Jv_AllocObjectNoFinalizer (&Number.class$$);
> #ref#3#6 = #ref#2#4;
> #ref#2#4 = #ref#3#6;
>
> Here, the #ref#3#6 and #ref#2#4 is a kind waste. But each "new" statement
> does the same thing.
The reason is because this is an exact translation of the java
byte-code. Most source to java byte-code compilers don't do any
optimizations which is why we get a lot of temporary variables here
(this includes the one included with Eclipse which is what GCJ uses as
the source compiler).
Thanks,
Andrew Pinski
next prev parent reply other threads:[~2011-08-09 16:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CA+kGxtPef8Xojf-+amOehmUsY_5MQreWUPdnODZUoX-tqX1RTg@mail.gmail.com>
2011-08-09 7:18 ` Li junsong
2011-08-09 16:22 ` Andrew Pinski [this message]
2011-08-15 9:40 ` Andrew Haley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CA+=Sn1mm-K-CyMH_Je2DFZgALBp-GvqzaL5pthgRSg65RSEhwg@mail.gmail.com' \
--to=pinskia@gmail.com \
--cc=java@gcc.gnu.org \
--cc=ljs.darkfish@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).