[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A java DEBUG flag

From: Bryce McKinlay
Subject: Re: A java DEBUG flag
Date: Fri, 24 Nov 2000 23:21:12 +1300

Mark Wielaard wrote:

> > > If we used something like
> > > System.getProperty("") to set these
> > > constants (you can even do that in an interface)
> >
> > I don't think so ;-)
> What don't you think so?
> What I meant was something like the following:
> interface I {
>         Boolean.getBoolean("");
> }

But this is not a constant! It can only be evaluated at runtime. A bytecode
compiler or native compiler like gcj cannot determine the value of the flag, and
must emit a branch. Granted, a smart JIT will be able to take advantage of it
being a final field and eliminate the debug code from what it generates. 
if it is used extensively in the runtime then it is probable that the flag would
be evaluated before the system property is set, making it useless.


  [ bryce ]

reply via email to

[Prev in Thread] Current Thread [Next in Thread]