Use of long in Nashorn
Hannes Wallnoefer
hannes.wallnoefer at oracle.com
Fri Dec 11 15:30:20 UTC 2015
Am 2015-12-11 um 16:21 schrieb Attila Szegedi:
> On Dec 11, 2015, at 4:08 PM, Hannes Wallnoefer <hannes.wallnoefer at oracle.com> wrote:
>
>> I didn't implement the int/double overloading of array iterator actions. Unless I missed something, I would have to implement two forEach methods in each subclass, which seem ugly and error prone.
> You haven’t missed anything; that’s exactly how that would work. Ultimately, if we had macros in Java, this wouldn’t need to look ugly, but we don’t have them, so… Performance optimizations are sometimes ugly :-) Anyway, this needn’t happen now, although ultimately I don’t think it’d be much of a big deal to implement, even with the unfortunate code duplication, and we still wouldn’t always force-promote the parameter type for the callback functions to double.
>
Ok, you convinced me. I'll add that optimization an upcoming webrev.
Still waiting for other reviews though.
Hannes
More information about the nashorn-dev
mailing list