This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Quick Optimization Question
- From: Andrew Haley <aph at redhat dot com>
- To: Mohan Embar <gnustuff at thisiscool dot com>
- Cc: java at gcc dot gnu dot org
- Date: Wed, 28 Mar 2007 17:23:10 +0100
- Subject: Re: Quick Optimization Question
- References: <CAB7DCTPGALHKISOURSP41E062970VP.460a94e5@parallels>
Mohan Embar writes:
> Hi All,
>
> Sorry if the answer to this is obvious, but I figured
> someone (Andrew) would know this off the top of his
> head.
>
> If I do this:
>
> public static final byte[] FOO = new byte[] {....};
>
> ...will gcj know to translate FOO.length into
> a constant at compile time?
There is some code in the compiler to do this particular optimization,
but I'm not sure it works in all cases.
Andrew.
--
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom.
Registered in England and Wales under Company Registration No. 3798903
Directors: Michael Cunningham (USA), Charlie Peters (USA) and David Owens (Ireland)