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

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

Issue 636283009: [turbofan] Use range types to type and lower arithmetic ops. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rename MaybeWeaken and rebase Created 6 years, 2 months 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-typer.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 c30be77420f2103f20ee9b8d68127838b4b12d96..e564c6c0808ab20f29d0fde37b12380d55343dcf 100644
--- a/test/cctest/test-types.cc
+++ b/test/cctest/test-types.cc
@@ -590,6 +590,8 @@ struct Tests : Rep {
}
void MinMax() {
+ Factory* fac = isolate->factory();
+
// If b is regular numeric bitset, then Range(b->Min(), b->Max())->Is(b).
// TODO(neis): Need to ignore representation for this to be true.
/*
@@ -608,8 +610,7 @@ struct Tests : Rep {
// If b is regular numeric bitset, then b->Min() and b->Max() are integers.
for (TypeIterator it = T.types.begin(); it != T.types.end(); ++it) {
TypeHandle type = *it;
- if (this->IsBitset(type) && type->Is(T.Number) &&
- !type->Is(T.None) && !type->Is(T.NaN)) {
+ if (this->IsBitset(type) && type->Is(T.Number) && !type->Is(T.NaN)) {
CHECK(IsInteger(type->Min()) && IsInteger(type->Max()));
}
}
@@ -637,6 +638,15 @@ struct Tests : Rep {
CHECK(lub->Min() <= type->Min() && type->Max() <= lub->Max());
}
}
+
+ // Rangification: If T->Is(Range(-inf,+inf)) and !T->Is(None), then
+ // T->Is(Range(T->Min(), T->Max())).
+ for (TypeIterator it = T.types.begin(); it != T.types.end(); ++it) {
+ TypeHandle type = *it;
+ CHECK(!(type->Is(T.Integer) && !type->Is(T.None)) ||
+ type->Is(T.Range(fac->NewNumber(type->Min()),
+ fac->NewNumber(type->Max()))));
+ }
}
void BitsetGlb() {
« no previous file with comments | « test/cctest/compiler/test-typer.cc ('k') | test/cctest/types-fuzz.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698