Review request for JDK-8066225

Marcus Lagergren marcus.lagergren at oracle.com
Mon Dec 8 14:54:32 UTC 2014


+1

> On 08 Dec 2014, at 15:22, Attila Szegedi <attila.szegedi at oracle.com> wrote:
> 
> Please review JDK-8066225 at <http://cr.openjdk.java.net/~attila/8066225/webrev.00> for <https://bugs.openjdk.java.net/browse/JDK-8066225>
> 
> 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.
> 
> Thanks,
>  Attila.
> 



More information about the nashorn-dev mailing list