I'm honestly not convinced how this is actually useful. And also, just
based on the name, I'd expect it to be something closer to `[min, max]
= Math.minMax(foo, bar)`, which could effectively compile down for
integers to up to two register `mov`s followed by a single `cmpxchggt`
(compare and exchange if greater than).
Not that engines couldn't similarly reduce this equivalent, but
engines are usually way dumber than they could be with some of the
more complex reductions:
```js
// This should compile to the same thing assuming `foo` and
// `bar` are both integers, but no engine AFAIK does this.
var min = foo, max = bar;
if (min > max) { var tmp = max; max = min; min = tmp }
// This should also compile similarly, provided `foo` and `bar`
// are both integers and constant reference reads.
var min = Math.min(foo, bar)
var max = Math.max(foo, bar)
```
-----
Isiah Meadows
[email protected]
Looking for web consulting? Or a new website?
Send me an email and we can get started.
www.isiahmeadows.com
On Fri, Jun 30, 2017 at 7:47 AM, Xavier Stouder <[email protected]> wrote:
> I just removed performance from goals of the proposal, given how it seems to
> depend about how min and max are called.
>
>
>
> Thanks for feedbacks.
>
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss