Avoid using C++ STL include <limits>.
authorlrn@chromium.org <lrn@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 26 Sep 2011 12:44:36 +0000 (12:44 +0000)
committerlrn@chromium.org <lrn@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 26 Sep 2011 12:44:36 +0000 (12:44 +0000)
Review URL: http://codereview.chromium.org/8041019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9428 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/conversions-inl.h
src/conversions.h
src/globals.h
src/v8globals.h

index 41cf0d5..8bc11bf 100644 (file)
@@ -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);
 }
 
 
index e51ad65..31aaf6b 100644 (file)
@@ -28,8 +28,6 @@
 #ifndef V8_CONVERSIONS_H_
 #define V8_CONVERSIONS_H_
 
-#include <limits>
-
 #include "utils.h"
 
 namespace v8 {
index 6c6966a..d0c78d6 100644 (file)
@@ -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;
index 6850397..3667ca6 100644 (file)
@@ -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);