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

Unified Diff: src/compiler/typer.cc

Issue 794663002: Revert of Avoid number range holes in bitset types. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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 | « no previous file | src/types.h » ('j') | 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 f04b0b42a645f9859166f75b0df052c53142c465..710487134edeff341d94e6b06b0f783962fe229c 100644
--- a/src/compiler/typer.cc
+++ b/src/compiler/typer.cc
@@ -165,6 +165,10 @@
boolean_or_number = Type::Union(Type::Boolean(), Type::Number(), zone);
undefined_or_null = Type::Union(Type::Undefined(), Type::Null(), zone);
undefined_or_number = Type::Union(Type::Undefined(), Type::Number(), zone);
+ negative_signed32 = Type::Union(
+ Type::SignedSmall(), Type::OtherSigned32(), zone);
+ non_negative_signed32 = Type::Union(
+ Type::UnsignedSmall(), Type::OtherUnsigned31(), zone);
singleton_false = Type::Constant(f->false_value(), zone);
singleton_true = Type::Constant(f->true_value(), zone);
singleton_zero = Type::Range(zero, zero, zone);
@@ -189,7 +193,8 @@
number_fun2_ = Type::Function(number, number, number, zone);
weakint_fun1_ = Type::Function(weakint, number, zone);
- random_fun_ = Type::Function(Type::OrderedNumber(), zone);
+ random_fun_ = Type::Function(Type::Union(
+ Type::UnsignedSmall(), Type::OtherNumber(), zone), zone);
const int limits_count = 20;
@@ -865,12 +870,11 @@
double rmax = rhs->Max();
if ((lmin >= 0 && rmin >= 0) || (lmax < 0 && rmax < 0)) {
// Xor-ing negative or non-negative values results in a non-negative value.
- return Type::NonNegativeSigned32();
+ return t->non_negative_signed32;
}
if ((lmax < 0 && rmin >= 0) || (lmin >= 0 && rmax < 0)) {
// Xor-ing a negative and a non-negative value results in a negative value.
- // TODO(jarin) Use a range here.
- return Type::NegativeSigned32();
+ return t->negative_signed32;
}
return Type::Signed32();
}
« no previous file with comments | « no previous file | src/types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698