Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Unified Diff: src/compiler/typer.cc

Issue 732173002: [WIP] Typ aided removal of redundant modulus. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/typer.cc
diff --git a/src/compiler/typer.cc b/src/compiler/typer.cc
index 996eecd361caacde8ae062304ac1180d68902e75..ce1ea188336830c0b15579ea8c4f62ac33e45d9d 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;
+ if (type->Is(Type::Union(Type::MinusZero(), Type::Signed32(), t->zone()))) {
+ return Type::Intersect(Type::Union(type, t->singleton_zero, t->zone()),
+ Type::Signed32(), t->zone());
+ }
return Type::Signed32();
}
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698