On 2013/11/12 10:14:56, Yang wrote:
On 2013/11/12 09:02:02, Jakob wrote:
> Nope.
>
> var double_one = Math.cos(0);
>
> function add(a, b) {
> return a + b;
> }
>
> assertEquals(1, 1/add(double_one, 0));
> assertEquals(1, 1/add(0, double_one));
> %OptimizeFunctionOnNextCall(add);
> assertEquals(1/(-0 + -0), 1/add(-0, -0));
I suggest adding both tests to minus-zero.js to increase coverage and
prevent
future mistakes.
Seems the optimization only applys to SMI. so the logic may change to below
if (representation().IsSmi() || type().IsSmi()) {
result->set_can_be_minus_zero(false);
} else {
result->set_can_be_minus_zero(!to().IsInteger32() ||
!CheckFlag(kAllUsesTruncatingToInt32));
}
Is is reasonable?
https://codereview.chromium.org/61893018/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.