Strings in Switch

Joseph D. Darcy Joe.Darcy at Sun.COM
Wed Dec 9 10:35:29 PST 2009


Mark Mahieu wrote:
> On 9 Dec 2009, at 10:53, Reinier Zwitserloot wrote:
>
>   
>> As I understand it, switch-in-strings is handled during the "lower" phase of
>> javac, which must desugar the string switch into legal java code.
>>     
>
> Hmm, that's not quite how I understand it.
>
> I picture the "lower" phase as a bridge between the side of javac which is concerned with the Java Language spec (parsing, flow analysis etc), and the side which deals with the VM spec (ie. bytecode generation).  Its existence means that neither side need be unnecessarily complicated by details of the other.
>
> So, its input is syntax trees which are valid as far as the language spec is concerned, and its output is a simpler set of trees which can be used by the "gen" phase to produce valid JVM classes - but that 'simpler' set is not necessarily an exact subset of the trees used by earlier phases; ie. the output need not be directly representable as valid Java *language* code (synthetics and some uses of "let" expressions for example).
>   

Mark,

Your description of Lower is correct.

-Joe



More information about the coin-dev mailing list