| Index: src/compiler/typer.cc
|
| diff --git a/src/compiler/typer.cc b/src/compiler/typer.cc
|
| index 0fa2b95ebd3460350def99acdd14b2341d7b1b00..914174eea8ed2ce04326e0f721c001b8f75e2537 100644
|
| --- a/src/compiler/typer.cc
|
| +++ b/src/compiler/typer.cc
|
| @@ -467,6 +467,10 @@ Type* Typer::Visitor::NumberToInt32(Type* type, Typer* t) {
|
| // TODO(neis): DCHECK(type->Is(Type::Number()));
|
| if (type->Is(Type::Signed32())) return type;
|
| if (type->Is(t->zeroish)) return t->singleton_zero;
|
| + Type* intish = Type::Union(Type::Signed32(), t->zeroish, t->zone());
|
| + if (type->Is(intish)) {
|
| + return Type::Intersect(Type::Signed32(), type, t->zone());
|
| + }
|
| return Type::Signed32();
|
| }
|
|
|
| @@ -725,6 +729,10 @@ Type* Typer::Visitor::JSBitwiseOrTyper(Type* lhs, Type* rhs, Typer* t) {
|
| Handle<Object> max = f->NewNumber(-1);
|
| return Type::Range(min, max, t->zone());
|
| }
|
| + if (rmax == 0 && rmin == 0) {
|
| + Handle<Object> max = f->NewNumber(lmax);
|
| + return Type::Range(min, max, t->zone());
|
| + }
|
| Handle<Object> max = f->NewNumber(Type::Signed32()->Max());
|
| return Type::Range(min, max, t->zone());
|
| // TODO(neis): Be precise for singleton inputs, here and elsewhere.
|
| @@ -1033,8 +1041,7 @@ Type* Typer::Visitor::JSModulusTyper(Type* lhs, Type* rhs, Typer* t) {
|
| lhs = Rangify(lhs, t);
|
| rhs = Rangify(rhs, t);
|
| if (lhs->IsRange() && rhs->IsRange()) {
|
| - // TODO(titzer): fix me.
|
| - // return JSModulusRanger(lhs->AsRange(), rhs->AsRange(), t);
|
| + return JSModulusRanger(lhs->AsRange(), rhs->AsRange(), t);
|
| }
|
| return Type::OrderedNumber();
|
| }
|
|
|