Version 3.4.10
Fixed debugger not breaking on certain "if" statements (issue 1523).
Fixed assertion failure in runtime profiler when running on IA32 without snapshot (issue 1522).
Fixed ABI for API calls on IA32 (for clang compatibility).
Introduced code flushing of RegExp code to free memory used by RegExps sooner.
Fixed linux-tick-processor built wrong version of v8 (issue 1532).
Fixed assertion failure in v8::TryCache::StackTrace (issue 1529).
Performance improvements on all platforms.
git-svn-id: http://v8.googlecode.com/svn/trunk@8550 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/conversions.h b/src/conversions.h
index 4cbeeca..c3e27b2 100644
--- a/src/conversions.h
+++ b/src/conversions.h
@@ -28,11 +28,36 @@
#ifndef V8_CONVERSIONS_H_
#define V8_CONVERSIONS_H_
+#include <limits>
+
#include "scanner-base.h"
namespace v8 {
namespace internal {
+// Maximum number of significant digits in decimal representation.
+// The longest possible double in decimal representation is
+// (2^53 - 1) * 2 ^ -1074 that is (2 ^ 53 - 1) * 5 ^ 1074 / 10 ^ 1074
+// (768 digits). If we parse a number whose first digits are equal to a
+// mean of 2 adjacent doubles (that could have up to 769 digits) the result
+// must be rounded to the bigger one unless the tail consists of zeros, so
+// we don't need to preserve all the digits.
+const int kMaxSignificantDigits = 772;
+
+static const double JUNK_STRING_VALUE =
+ std::numeric_limits<double>::quiet_NaN();
+
+static bool isDigit(int x, int radix) {
+ return (x >= '0' && x <= '9' && x < '0' + radix)
+ || (radix > 10 && x >= 'a' && x < 'a' + radix - 10)
+ || (radix > 10 && x >= 'A' && x < 'A' + radix - 10);
+}
+
+
+static double SignedZero(bool negative) {
+ return negative ? -0.0 : 0.0;
+}
+
// The fast double-to-(unsigned-)int conversion routine does not guarantee
// rounding towards zero.
@@ -87,17 +112,8 @@
};
-// Convert from Number object to C integer.
-static inline int32_t NumberToInt32(Object* number);
-static inline uint32_t NumberToUint32(Object* number);
-
-
// Converts a string into a double value according to ECMA-262 9.3.1
double StringToDouble(UnicodeCache* unicode_cache,
- String* str,
- int flags,
- double empty_string_val = 0);
-double StringToDouble(UnicodeCache* unicode_cache,
Vector<const char> str,
int flags,
double empty_string_val = 0);
@@ -111,9 +127,6 @@
int flags,
double empty_string_val = 0);
-// Converts a string into an integer.
-double StringToInt(UnicodeCache* unicode_cache, String* str, int radix);
-
// Converts a double to a string value according to ECMA-262 9.8.1.
// The buffer should be large enough for any floating point number.
// 100 characters is enough.