This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Quick Optimization Question


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)


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