assert facility
Bryce McKinlay
bryce@waitaki.otago.ac.nz
Wed Jun 12 05:05:00 GMT 2002
shudo@computer.org wrote:
>If compilation is performed at runtime, conditional branches for
>assertions can be eliminated by (runtime-)constant propagation.
>But, I'm not sure whether it could be possible for GCJ.
>
Right. There will always be some branch cost for an assertion in GCJ if
the assertions are enabled at compile time. But, branch prediction hints
can be set to always assume the assertion will not trigger, which can
reduce their cost on modern hardware.
>Should we provide a gcj flag to eliminate all assertions?
>For native code, yes. For generating bytecode we should just follow what
Sun recommends.
regards
Bryce.
More information about the Java
mailing list