Review request for JDK-8066225

Hannes Wallnoefer hannes.wallnoefer at oracle.com
Wed Dec 10 11:06:43 UTC 2014


+1

Am 2014-12-08 um 15:22 schrieb Attila Szegedi:
> 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