public inbox for
 help / color / mirror / Atom feed
From: Andrew Pinski <>
To: Li junsong <>
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: <> (raw)
In-Reply-To: <>

On Tue, Aug 9, 2011 at 12:18 AM, Li junsong <> 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).

Andrew Pinski

  reply	other threads:[~2011-08-09 16:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <>
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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='' \ \ \ \

* 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).