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

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

Issue 443123002: Revert "Extend some operations to range types." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 | « src/types.cc ('k') | no next file » | 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 bc73babb8f45e204249400c0f2b6e7e8c91fb449..9279ccb9ede954c81e29895f7325d556e2724a5e 100644
--- a/test/cctest/test-types.cc
+++ b/test/cctest/test-types.cc
@@ -189,21 +189,6 @@ class Types {
ValueVector values;
DoubleVector doubles; // Some floating-point values, excluding NaN.
- // Range type helper functions, partially copied from types.cc.
- // Note: le(min(x,y), max(x,y)) holds iff neither x nor y is NaN.
- bool le(double x, double y) {
- return x <= y && copysign(1, x) <= copysign(1, y);
- }
- bool eq(double x, double y) {
- return le(x, y) && le(y, x);
- }
- double min(double x, double y) {
- return le(x, y) ? x : y;
- }
- double max(double x, double y) {
- return le(x, y) ? y : x;
- }
-
TypeHandle Of(Handle<i::Object> value) {
return Type::Of(value, region_);
}
@@ -564,8 +549,8 @@ struct Tests : Rep {
// Constructor
for (DoubleIterator i = T.doubles.begin(); i != T.doubles.end(); ++i) {
for (DoubleIterator j = T.doubles.begin(); j != T.doubles.end(); ++j) {
- double min = T.min(*i, *j);
- double max = T.max(*i, *j);
+ double min = std::min(*i, *j);
+ double max = std::max(*i, *j);
TypeHandle type = T.Range(min, max);
CHECK(type->IsRange());
}
@@ -574,8 +559,8 @@ struct Tests : Rep {
// Range attributes
for (DoubleIterator i = T.doubles.begin(); i != T.doubles.end(); ++i) {
for (DoubleIterator j = T.doubles.begin(); j != T.doubles.end(); ++j) {
- double min = T.min(*i, *j);
- double max = T.max(*i, *j);
+ double min = std::min(*i, *j);
+ double max = std::max(*i, *j);
printf("RangeType: min, max = %f, %f\n", min, max);
TypeHandle type = T.Range(min, max);
printf("RangeType: Min, Max = %f, %f\n",
@@ -594,14 +579,13 @@ struct Tests : Rep {
// i2 != T.doubles.end(); ++i2) {
// for (DoubleIterator j2 = T.doubles.begin();
// j2 != T.doubles.end(); ++j2) {
-// double min1 = T.min(*i1, *j1);
-// double max1 = T.max(*i1, *j1);
-// double min2 = T.min(*i2, *j2);
-// double max2 = T.max(*i2, *j2);
+// double min1 = std::min(*i1, *j1);
+// double max1 = std::max(*i1, *j1);
+// double min2 = std::min(*i2, *j2);
+// double max2 = std::max(*i2, *j2);
// TypeHandle type1 = T.Range(min1, max1);
// TypeHandle type2 = T.Range(min2, max2);
-// CHECK(Equal(type1, type2) ==
-// (T.eq(min1, min2) && T.eq(max1, max2)));
+// CHECK(Equal(type1, type2) == (min1 == min2 && max1 == max2));
// }
// }
// }
« no previous file with comments | « src/types.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698