Review request for JDK-8066225

Attila Szegedi attila.szegedi at
Mon Dec 8 14:22:12 UTC 2014

Please review JDK-8066225 at <> for <>

I changed SwitchNode.isInteger() method to SwitchNode.isUniqueInteger() (it returns true if all cases are 32-bit integer constants, *and* there are no repetitions among them). Duplicates will have us switch to if/else compilation instead of tableswith/lookupswitch. 

Also, instead of having this method's return value being calculated on every invocation (it is invoked at least 4 times; potentially more in LocalVariableTypesCalculator if it's in a loop), I moved the calculation to only happen once, in FoldConstants (after the case node expressions have been constant-folded) and subsequently storing it in a boolean field.


More information about the nashorn-dev mailing list