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

Unified Diff: src/types.cc

Issue 798413003: Remove obsolete V8_INFINITY macro. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address Svens smiley. 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 | « src/strtod.cc ('k') | test/cctest/compiler/codegen-tester.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/types.cc
diff --git a/src/types.cc b/src/types.cc
index c4f1bae5fbcf4d3695a20e1b631e3860727467ee..fe29d9dbad4cfff80d442e8f4587cfad34223235 100644
--- a/src/types.cc
+++ b/src/types.cc
@@ -2,10 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <iomanip>
-
#include "src/types.h"
+#include <iomanip>
+#include <limits>
+
#include "src/ostreams.h"
#include "src/types-inl.h"
@@ -81,7 +82,7 @@ double TypeImpl<Config>::Min() {
DCHECK(this->Is(Number()));
if (this->IsBitset()) return BitsetType::Min(this->AsBitset());
if (this->IsUnion()) {
- double min = +V8_INFINITY;
+ double min = +std::numeric_limits<double>::infinity();
for (int i = 0, n = this->AsUnion()->Length(); i < n; ++i) {
min = std::min(min, this->AsUnion()->Get(i)->Min());
}
@@ -99,7 +100,7 @@ double TypeImpl<Config>::Max() {
DCHECK(this->Is(Number()));
if (this->IsBitset()) return BitsetType::Max(this->AsBitset());
if (this->IsUnion()) {
- double max = -V8_INFINITY;
+ double max = -std::numeric_limits<double>::infinity();
for (int i = 0, n = this->AsUnion()->Length(); i < n; ++i) {
max = std::max(max, this->AsUnion()->Get(i)->Max());
}
@@ -287,7 +288,7 @@ TypeImpl<Config>::BitsetType::Lub(double value) {
template <class Config>
const typename TypeImpl<Config>::BitsetType::BitsetMin
TypeImpl<Config>::BitsetType::BitsetMins31[] = {
- {kOtherNumber, -V8_INFINITY},
+ {kOtherNumber, -std::numeric_limits<double>::infinity()},
{kOtherSigned32, kMinInt},
{kNegativeSignedSmall, -0x40000000},
{kUnsignedSmall, 0},
@@ -301,7 +302,7 @@ const typename TypeImpl<Config>::BitsetType::BitsetMin
template <class Config>
const typename TypeImpl<Config>::BitsetType::BitsetMin
TypeImpl<Config>::BitsetType::BitsetMins32[] = {
- {kOtherNumber, -V8_INFINITY},
+ {kOtherNumber, -std::numeric_limits<double>::infinity()},
{kNegativeSignedSmall, kMinInt},
{kUnsignedSmall, 0},
{kOtherUnsigned32, 0x80000000},
@@ -353,7 +354,7 @@ double TypeImpl<Config>::BitsetType::Max(bitset bits) {
const BitsetMin* mins = BitsetMins();
bool mz = SEMANTIC(bits & kMinusZero);
if (BitsetType::Is(mins[BitsetMinsSize()-1].bits, bits)) {
- return +V8_INFINITY;
+ return +std::numeric_limits<double>::infinity();
}
for (size_t i = BitsetMinsSize()-1; i-- > 0; ) {
if (Is(SEMANTIC(mins[i].bits), bits)) {
« no previous file with comments | « src/strtod.cc ('k') | test/cctest/compiler/codegen-tester.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698