classpath
[Top][All Lists]
Advanced

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

Re: Math patch


From: Chris Gray
Subject: Re: Math patch
Date: Fri, 28 Feb 2003 14:19:35 +0100 (CET)

On Fri, 28 Feb 2003, Artur Biesiadowski wrote:

> Chris Gray wrote:
> 
> > Nonetheless, javac certainly used to do that, and I'm pretty sure it still 
> > does. (I could swear that the JLS actually specifies this behaviour, but 
> > I'm darned if I can find the words now.)  
> 
> 13.4.8
> 
> http://java.sun.com/docs/books/jls/second_edition/html/binaryComp.doc.html#45139
> 
> [...]
> One reason for requiring inlining of constants is that switch statements 
> require constants on each case, and no two such constant values may be 
> the same. The compiler checks for duplicate constant values in a switch 
> statement at compile time; the class file format does not do symbolic 
> linkage of case values
> [...]

Knew it was there somewhere. :) Thx.

IMO that text is just a bogus justification for a misguided "optimisation" 
built into ur-javac. They could as well have said that if two switch cases 
turn out at runtime to be the same then the result is undefined. As it is 
we have major breakage. :(

-- 

Chris Gray

VM Architect, ACUNIA






reply via email to

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