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

Unified Diff: test/cctest/test-types.cc

Issue 759013003: Avoid number range holes in bitset types. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Another rebase 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 | « test/cctest/compiler/test-js-typed-lowering.cc ('k') | test/cctest/types-fuzz.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-types.cc
diff --git a/test/cctest/test-types.cc b/test/cctest/test-types.cc
index 6e06890214d79a8fde4c828d06b0b6d4fe827113..a96c524c529b4f52140a2663afcd0efbbe543059 100644
--- a/test/cctest/test-types.cc
+++ b/test/cctest/test-types.cc
@@ -294,39 +294,55 @@ struct Tests : Rep {
CHECK(T.Constant(fac->NewNumber(0))->Is(T.UnsignedSmall));
CHECK(T.Constant(fac->NewNumber(1))->Is(T.UnsignedSmall));
CHECK(T.Constant(fac->NewNumber(0x3fffffff))->Is(T.UnsignedSmall));
- CHECK(T.Constant(fac->NewNumber(-1))->Is(T.OtherSignedSmall));
- CHECK(T.Constant(fac->NewNumber(-0x3fffffff))->Is(T.OtherSignedSmall));
- CHECK(T.Constant(fac->NewNumber(-0x40000000))->Is(T.OtherSignedSmall));
+ CHECK(T.Constant(fac->NewNumber(-1))->Is(T.NegativeSignedSmall));
+ CHECK(T.Constant(fac->NewNumber(-0x3fffffff))->Is(T.NegativeSignedSmall));
+ CHECK(T.Constant(fac->NewNumber(-0x40000000))->Is(T.NegativeSignedSmall));
if (SmiValuesAre31Bits()) {
- CHECK(T.Constant(fac->NewNumber(0x40000000))->Is(T.OtherUnsigned31));
- CHECK(T.Constant(fac->NewNumber(0x7fffffff))->Is(T.OtherUnsigned31));
- CHECK(T.Constant(fac->NewNumber(-0x40000001))->Is(T.OtherSigned32));
- CHECK(T.Constant(fac->NewNumber(-0x7fffffff))->Is(T.OtherSigned32));
- CHECK(T.Constant(fac->NewNumber(-0x7fffffff-1))->Is(T.OtherSigned32));
+ CHECK(T.Constant(fac->NewNumber(0x40000000))->Is(T.NonNegativeSigned32));
+ CHECK(!T.Constant(fac->NewNumber(0x40000000))->Is(T.UnsignedSmall));
+ CHECK(T.Constant(fac->NewNumber(0x7fffffff))->Is(T.NonNegativeSigned32));
+ CHECK(!T.Constant(fac->NewNumber(0x7fffffff))->Is(T.UnsignedSmall));
+ CHECK(T.Constant(fac->NewNumber(-0x40000001))->Is(T.NegativeSigned32));
+ CHECK(
+ !T.Constant(fac->NewNumber(-0x40000001))->Is(T.NegativeSignedSmall));
+ CHECK(T.Constant(fac->NewNumber(-0x7fffffff))->Is(T.NegativeSigned32));
+ CHECK(!T.Constant(fac->NewNumber(-0x7fffffff - 1))
+ ->Is(T.NegativeSignedSmall));
} else {
CHECK(SmiValuesAre32Bits());
CHECK(T.Constant(fac->NewNumber(0x40000000))->Is(T.UnsignedSmall));
CHECK(T.Constant(fac->NewNumber(0x7fffffff))->Is(T.UnsignedSmall));
- CHECK(!T.Constant(fac->NewNumber(0x40000000))->Is(T.OtherUnsigned31));
- CHECK(!T.Constant(fac->NewNumber(0x7fffffff))->Is(T.OtherUnsigned31));
- CHECK(T.Constant(fac->NewNumber(-0x40000001))->Is(T.OtherSignedSmall));
- CHECK(T.Constant(fac->NewNumber(-0x7fffffff))->Is(T.OtherSignedSmall));
- CHECK(T.Constant(fac->NewNumber(-0x7fffffff-1))->Is(T.OtherSignedSmall));
- CHECK(!T.Constant(fac->NewNumber(-0x40000001))->Is(T.OtherSigned32));
- CHECK(!T.Constant(fac->NewNumber(-0x7fffffff))->Is(T.OtherSigned32));
- CHECK(!T.Constant(fac->NewNumber(-0x7fffffff-1))->Is(T.OtherSigned32));
- }
- CHECK(T.Constant(fac->NewNumber(0x80000000u))->Is(T.OtherUnsigned32));
- CHECK(T.Constant(fac->NewNumber(0xffffffffu))->Is(T.OtherUnsigned32));
- CHECK(T.Constant(fac->NewNumber(0xffffffffu+1.0))->Is(T.OtherNumber));
- CHECK(T.Constant(fac->NewNumber(-0x7fffffff-2.0))->Is(T.OtherNumber));
- CHECK(T.Constant(fac->NewNumber(0.1))->Is(T.OtherNumber));
- CHECK(T.Constant(fac->NewNumber(-10.1))->Is(T.OtherNumber));
- CHECK(T.Constant(fac->NewNumber(10e60))->Is(T.OtherNumber));
+ CHECK(T.Constant(fac->NewNumber(0x40000000))->Is(T.NonNegativeSigned32));
+ CHECK(T.Constant(fac->NewNumber(0x7fffffff))->Is(T.NonNegativeSigned32));
+ CHECK(T.Constant(fac->NewNumber(-0x40000001))->Is(T.NegativeSignedSmall));
+ CHECK(T.Constant(fac->NewNumber(-0x7fffffff))->Is(T.NegativeSignedSmall));
+ CHECK(T.Constant(fac->NewNumber(-0x7fffffff - 1))
+ ->Is(T.NegativeSignedSmall));
+ CHECK(T.Constant(fac->NewNumber(-0x40000001))->Is(T.NegativeSigned32));
+ CHECK(T.Constant(fac->NewNumber(-0x7fffffff))->Is(T.NegativeSigned32));
+ CHECK(
+ T.Constant(fac->NewNumber(-0x7fffffff - 1))->Is(T.NegativeSigned32));
+ }
+ CHECK(T.Constant(fac->NewNumber(0x80000000u))->Is(T.Unsigned32));
+ CHECK(!T.Constant(fac->NewNumber(0x80000000u))->Is(T.NonNegativeSigned32));
+ CHECK(T.Constant(fac->NewNumber(0xffffffffu))->Is(T.Unsigned32));
+ CHECK(!T.Constant(fac->NewNumber(0xffffffffu))->Is(T.NonNegativeSigned32));
+ CHECK(T.Constant(fac->NewNumber(0xffffffffu + 1.0))->Is(T.PlainNumber));
+ CHECK(!T.Constant(fac->NewNumber(0xffffffffu + 1.0))->Is(T.Integral32));
+ CHECK(T.Constant(fac->NewNumber(-0x7fffffff - 2.0))->Is(T.PlainNumber));
+ CHECK(!T.Constant(fac->NewNumber(-0x7fffffff - 2.0))->Is(T.Integral32));
+ CHECK(T.Constant(fac->NewNumber(0.1))->Is(T.PlainNumber));
+ CHECK(!T.Constant(fac->NewNumber(0.1))->Is(T.Integral32));
+ CHECK(T.Constant(fac->NewNumber(-10.1))->Is(T.PlainNumber));
+ CHECK(!T.Constant(fac->NewNumber(-10.1))->Is(T.Integral32));
+ CHECK(T.Constant(fac->NewNumber(10e60))->Is(T.PlainNumber));
+ CHECK(!T.Constant(fac->NewNumber(10e60))->Is(T.Integral32));
CHECK(T.Constant(fac->NewNumber(-1.0*0.0))->Is(T.MinusZero));
CHECK(T.Constant(fac->NewNumber(v8::base::OS::nan_value()))->Is(T.NaN));
- CHECK(T.Constant(fac->NewNumber(V8_INFINITY))->Is(T.OtherNumber));
- CHECK(T.Constant(fac->NewNumber(-V8_INFINITY))->Is(T.OtherNumber));
+ CHECK(T.Constant(fac->NewNumber(V8_INFINITY))->Is(T.PlainNumber));
+ CHECK(!T.Constant(fac->NewNumber(V8_INFINITY))->Is(T.Integral32));
+ CHECK(T.Constant(fac->NewNumber(-V8_INFINITY))->Is(T.PlainNumber));
+ CHECK(!T.Constant(fac->NewNumber(-V8_INFINITY))->Is(T.Integral32));
}
void Range() {
@@ -904,7 +920,7 @@ struct Tests : Rep {
if (type->IsRange()) {
TypeHandle lub = Rep::BitsetType::New(
Rep::BitsetType::Lub(type), T.region());
- CHECK(lub->Is(T.Union(T.Integral32, T.OtherNumber)));
+ CHECK(lub->Is(T.PlainNumber));
}
}
« no previous file with comments | « test/cctest/compiler/test-js-typed-lowering.cc ('k') | test/cctest/types-fuzz.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698