[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
mjs
mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:04:14 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit a964a983231968019b6d62a279bf191014271b79
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Oct 22 21:31:46 2003 +0000
Merged 64-bit compilation fixes, and fixes for handling negative 0
from upstream kjs.
* kjs/internal.cpp:
* kjs/simple_number.h:
(KJS::SimpleNumber): fixed constants; added negZero constant.
(KJS::SimpleNumber::is): adjusted to use long and not int.
(KJS::SimpleNumber::value): ditto.
(KJS::SimpleNumber::fits): ditto; also don't allow -0 to fit, so
we don't lose the distinction between -0 and +0.
(KJS::SimpleNumber::make): adjusted to use long.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5239 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index fd3fdb9..d971256 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,17 @@
+2003-10-22 Maciej Stachowiak <mjs at apple.com>
+
+ Merged 64-bit compilation fixes, and fixes for handling negative 0
+ from upstream kjs.
+
+ * kjs/internal.cpp:
+ * kjs/simple_number.h:
+ (KJS::SimpleNumber): fixed constants; added negZero constant.
+ (KJS::SimpleNumber::is): adjusted to use long and not int.
+ (KJS::SimpleNumber::value): ditto.
+ (KJS::SimpleNumber::fits): ditto; also don't allow -0 to fit, so
+ we don't lose the distinction between -0 and +0.
+ (KJS::SimpleNumber::make): adjusted to use long.
+
2003-10-18 Darin Adler <darin at apple.com>
Reviewed by Dave.
diff --git a/JavaScriptCore/ChangeLog-2003-10-25 b/JavaScriptCore/ChangeLog-2003-10-25
index fd3fdb9..d971256 100644
--- a/JavaScriptCore/ChangeLog-2003-10-25
+++ b/JavaScriptCore/ChangeLog-2003-10-25
@@ -1,3 +1,17 @@
+2003-10-22 Maciej Stachowiak <mjs at apple.com>
+
+ Merged 64-bit compilation fixes, and fixes for handling negative 0
+ from upstream kjs.
+
+ * kjs/internal.cpp:
+ * kjs/simple_number.h:
+ (KJS::SimpleNumber): fixed constants; added negZero constant.
+ (KJS::SimpleNumber::is): adjusted to use long and not int.
+ (KJS::SimpleNumber::value): ditto.
+ (KJS::SimpleNumber::fits): ditto; also don't allow -0 to fit, so
+ we don't lose the distinction between -0 and +0.
+ (KJS::SimpleNumber::make): adjusted to use long.
+
2003-10-18 Darin Adler <darin at apple.com>
Reviewed by Dave.
diff --git a/JavaScriptCore/kjs/internal.cpp b/JavaScriptCore/kjs/internal.cpp
index 0fa7155..65b928c 100644
--- a/JavaScriptCore/kjs/internal.cpp
+++ b/JavaScriptCore/kjs/internal.cpp
@@ -283,6 +283,8 @@ bool NumberImp::toUInt32(unsigned& uint32) const
return (double)uint32 == val;
}
+double SimpleNumber::negZero = -0.0;
+
// ------------------------------ LabelStack -----------------------------------
LabelStack::LabelStack(const LabelStack &other)
diff --git a/JavaScriptCore/kjs/simple_number.h b/JavaScriptCore/kjs/simple_number.h
index 9416b97..e5b5564 100644
--- a/JavaScriptCore/kjs/simple_number.h
+++ b/JavaScriptCore/kjs/simple_number.h
@@ -25,23 +25,27 @@
#include <limits.h>
#include <math.h>
+#include <string.h>
+
+#define IS_NEGATIVE_ZERO(num) (num == 0.0 && !memcmp(&num,&SimpleNumber::negZero,sizeof(double)))
namespace KJS {
class ValueImp;
class SimpleNumber {
public:
- enum { tag = 1, shift = 2, mask = (1 << shift) - 1, sign = 1 << 31, max = (1 << (31 - shift)) - 1, min = -max - 1 };
+ enum { tag = 1, shift = 2, mask = (1 << shift) - 1, sign = 1L << (sizeof(long) * 8 - 1 ), max = (1L << ((sizeof(long) * 8 - 1) - shift)) - 1, min = -max - 1, imax = (1L << ((sizeof(int) * 8 - 1) - shift)) - 1, imin = -imax - 1 };
- static inline bool is(const ValueImp *imp) { return ((int)imp & mask) == tag; }
- static inline int value(const ValueImp *imp) { return ((int)imp >> shift) | (((int)imp & sign) ? ~max : 0); }
+ static inline bool is(const ValueImp *imp) { return ((long)imp & mask) == tag; }
+ static inline long value(const ValueImp *imp) { return ((long)imp >> shift) | (((long)imp & sign) ? ~max : 0); }
- static inline bool fits(int i) { return i <= max && i >= min; }
+ static inline bool fits(int i) { return i <= imax && i >= imin; }
static inline bool fits(unsigned i) { return i <= (unsigned)max; }
static inline bool fits(long i) { return i <= max && i >= min; }
static inline bool fits(unsigned long i) { return i <= (unsigned)max; }
- static inline bool fits(double d) { return d <= max && d >= min && d == (double)(int)d; }
- static inline ValueImp *make(int i) { return (ValueImp *)((i << shift) | tag); }
+ static inline bool fits(double d) { return d <= max && d >= min && d == (double)(long)d &&
+ !IS_NEGATIVE_ZERO(d); }
+ static inline ValueImp *make(long i) { return (ValueImp *)((i << shift) | tag); }
};
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list