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: assert facility


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.





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