Chromium Code Reviews| Index: src/compiler/operation-typer.cc |
| diff --git a/src/compiler/operation-typer.cc b/src/compiler/operation-typer.cc |
| index dfd4c4b60477cad6b154fcbaeb123d472cc85235..fd6dfa444abc15f30e52a5fa7ac675ee55503d97 100644 |
| --- a/src/compiler/operation-typer.cc |
| +++ b/src/compiler/operation-typer.cc |
| @@ -625,13 +625,20 @@ Type* OperationTyper::NumberDivide(Type* lhs, Type* rhs) { |
| } |
| if (lhs->Is(Type::NaN()) || rhs->Is(Type::NaN())) return Type::NaN(); |
| + |
| // Division is tricky, so all we do is try ruling out -0 and NaN. |
| - bool maybe_minuszero = !lhs->Is(cache_.kPositiveIntegerOrNaN) || |
| - !rhs->Is(cache_.kPositiveIntegerOrNaN); |
| bool maybe_nan = |
| lhs->Maybe(Type::NaN()) || rhs->Maybe(cache_.kZeroish) || |
| ((lhs->Min() == -V8_INFINITY || lhs->Max() == +V8_INFINITY) && |
| (rhs->Min() == -V8_INFINITY || rhs->Max() == +V8_INFINITY)); |
| + lhs = Type::Intersect(lhs, Type::OrderedNumber(), zone()); |
| + rhs = Type::Intersect(rhs, Type::OrderedNumber(), zone()); |
| + |
| + // Try to rule out -0. |
| + bool maybe_minuszero = |
| + lhs->Maybe(Type::MinusZero()) || |
| + (lhs->Maybe(cache_.kZeroish) && rhs->Min() < 0.0) || |
| + (rhs->Min() == -V8_INFINITY || rhs->Max() == +V8_INFINITY); |
|
Jarin
2017/03/07 14:00:27
As discussed offline, this is not correct because
Benedikt Meurer
2017/03/07 14:16:38
Done.
|
| // Take into account the -0 and NaN information computed earlier. |
| Type* type = Type::PlainNumber(); |