Chromium Code Reviews| Index: src/compiler/typer.cc |
| diff --git a/src/compiler/typer.cc b/src/compiler/typer.cc |
| index 9af65597bf5527e9d60ca3c67b38300726cfe1bb..2f01e14243e95776467dee26dcae281a99456459 100644 |
| --- a/src/compiler/typer.cc |
| +++ b/src/compiler/typer.cc |
| @@ -350,6 +350,7 @@ class Typer::Visitor : public Reducer { |
| static Type* JSMultiplyRanger(Type::RangeType*, Type::RangeType*, Typer*); |
| static Type* JSDivideRanger(Type::RangeType*, Type::RangeType*, Typer*); |
| static Type* JSModulusRanger(Type::RangeType*, Type::RangeType*, Typer*); |
| + static Type* JSExponentiateRanger(Type::RangeType*, Type::RangeType*, Typer*); |
| static ComparisonOutcome JSCompareTyper(Type*, Type*, Typer*); |
| @@ -1223,6 +1224,18 @@ Type* Typer::Visitor::JSModulusTyper(Type* lhs, Type* rhs, Typer* t) { |
| } |
| +Type* Typer::Visitor::JSExponentiateRanger(Type::RangeType* lhs, |
| + Type::RangeType* rhs, Typer* t) { |
| + return Type::Range(-V8_INFINITY, +V8_INFINITY, t->zone()); |
|
Michael Starzinger
2015/02/24 14:09:03
This is a pretty broad range. :)
caitp (gmail)
2015/02/24 14:56:12
I have some ideas for how to make it a bit more na
|
| +} |
| + |
| + |
| +Type* Typer::Visitor::JSExponentiateTyper(Type* lhs, Type* rhs, Typer* t) { |
| + if (lhs->Is(Type::NaN()) || rhs->Is(Type::NaN())) return Type::NaN(); |
|
Michael Starzinger
2015/02/24 14:09:03
Isn't the exponentiation supposed to perform an im
caitp (gmail)
2015/02/24 14:56:12
I might be misunderstanding what the typer is doin
|
| + return Type::Number(); |
| +} |
| + |
| + |
| // JS unary operators. |
| @@ -1576,6 +1589,11 @@ Bounds Typer::Visitor::TypeNumberModulus(Node* node) { |
| } |
| +Bounds Typer::Visitor::TypeNumberExponentiate(Node* node) { |
| + return Bounds(Type::None(zone()), Type::Number(zone())); |
| +} |
| + |
| + |
| Bounds Typer::Visitor::TypeNumberToInt32(Node* node) { |
| return TypeUnaryOp(node, NumberToInt32); |
| } |