Commit d554977c authored by lrn@chromium.org's avatar lrn@chromium.org

Avoid using C++ STL include <limits>.

Review URL: http://codereview.chromium.org/8041019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9428 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent c1b978c0
......@@ -47,7 +47,7 @@ namespace v8 {
namespace internal {
static inline double JunkStringValue() {
return std::numeric_limits<double>::quiet_NaN();
return BitCast<double, uint64_t>(kQuietNaNMask);
}
......
......@@ -28,8 +28,6 @@
#ifndef V8_CONVERSIONS_H_
#define V8_CONVERSIONS_H_
#include <limits>
#include "utils.h"
namespace v8 {
......
......@@ -255,6 +255,10 @@ const int kBinary32MinExponent = 0x01;
const int kBinary32MantissaBits = 23;
const int kBinary32ExponentShift = 23;
// Quiet NaNs have bits 51 to 62 set, possibly the sign bit, and no
// other bits set.
const uint64_t kQuietNaNMask = static_cast<uint64_t>(0xfff) << 51;
// ASCII/UC16 constants
// Code-point values in Unicode 4.0 are 21 bits wide.
typedef uint16_t uc16;
......
......@@ -100,10 +100,6 @@ const int kPageSizeBits = 20;
const int kProcessorCacheLineSize = 64;
// Constants relevant to double precision floating point numbers.
// Quiet NaNs have bits 51 to 62 set, possibly the sign bit, and no
// other bits set.
const uint64_t kQuietNaNMask = static_cast<uint64_t>(0xfff) << 51;
// If looking only at the top 32 bits, the QNaN mask is bits 19 to 30.
const uint32_t kQuietNaNHighBitsMask = 0xfff << (51 - 32);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment