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

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

Issue 450473002: 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 fe34df347440431fca2a5296d28c51b91a40f073..9279ccb9ede954c81e29895f7325d556e2724a5e 100644
--- a/test/cctest/test-types.cc
+++ b/test/cctest/test-types.cc
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <math.h>
#include <vector>
#include "src/hydrogen-types.h"
@@ -140,7 +139,7 @@ class Types {
NumberFunction2 = Type::Function(Number, Number, Number, region);
MethodFunction = Type::Function(String, Object, 0, region);
- for (int i = 0; i < 30; ++i) {
+ for (int i = 0; i < 40; ++i) {
types.push_back(Fuzz());
}
}
@@ -190,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: dle(dmin(x,y), dmax(x,y)) holds iff neither x nor y is NaN.
- bool dle(double x, double y) {
- return x <= y && copysign(1, x) <= copysign(1, y);
- }
- bool deq(double x, double y) {
- return dle(x, y) && dle(y, x);
- }
- double dmin(double x, double y) {
- return dle(x, y) ? x : y;
- }
- double dmax(double x, double y) {
- return dle(x, y) ? y : x;
- }
-
TypeHandle Of(Handle<i::Object> value) {
return Type::Of(value, region_);
}
@@ -565,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.dmin(*i, *j);
- double max = T.dmax(*i, *j);
+ double min = std::min(*i, *j);
+ double max = std::max(*i, *j);
TypeHandle type = T.Range(min, max);
CHECK(type->IsRange());
}
@@ -575,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.dmin(*i, *j);
- double max = T.dmax(*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",
@@ -595,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.dmin(*i1, *j1);
-// double max1 = T.dmax(*i1, *j1);
-// double min2 = T.dmin(*i2, *j2);
-// double max2 = T.dmax(*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.deq(min1, min2) && T.deq(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