Re: [Jamvm-general] Can JamVM optimize away static branches?
Brought to you by:
rlougher
From: Xerxes R. <xe...@za...> - 2012-02-23 14:30:28
|
2012-02-23 15:21, David Griffiths skrev: > The javac compiler optimizes them away before JamVM even gets a look in: > > $ cat foo.java > public class foo { > static final boolean DEBUG=false; > > public static void main(String[] args) { > if (DEBUG) { > System.out.println("hello"); > } > } > } > > $ javap -c foo > Compiled from "foo.java" > public class foo extends java.lang.Object{ > static final boolean DEBUG; > > public foo(); > Code: > 0: aload_0 > 1: invokespecial #1; //Method java/lang/Object."<init>":()V > 4: return > > public static void main(java.lang.String[]); > Code: > 0: return > > } > > Cheers, > > Dave Ok! Thanks Dave for checking! Cheers, Xerxes > > > On 23 February 2012 12:59, Xerxes Rånby <xe...@za... <mailto:xe...@za...>> wrote: > > Hi > > Inside the JogAmp JOGL bindings a lot of code look like this: > > static final boolean DEBUG=false; > if(DEBUG) { verbose stuff .. } > > Do JamVM optimize away these static branches? > > Cheers > Xerxes > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Jamvm-general mailing list > Jam...@li... <mailto:Jam...@li...> > https://lists.sourceforge.net/lists/listinfo/jamvm-general > > |