summaryrefslogtreecommitdiff
path: root/debian/patches/dyson-js-solaris-memory-layout.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/dyson-js-solaris-memory-layout.patch')
-rw-r--r--debian/patches/dyson-js-solaris-memory-layout.patch129
1 files changed, 129 insertions, 0 deletions
diff --git a/debian/patches/dyson-js-solaris-memory-layout.patch b/debian/patches/dyson-js-solaris-memory-layout.patch
new file mode 100644
index 0000000..c9f0bb8
--- /dev/null
+++ b/debian/patches/dyson-js-solaris-memory-layout.patch
@@ -0,0 +1,129 @@
+Description: Patch for Solaris 64-bit memory layout
+Bug-Dyson: http://osdyson.org/issues/160
+Bug-Dyson: http://osdyson.org/issues/145
+Bug-Dyson: http://osdyson.org/issues/159
+Bug-Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=577056
+Index: qtscript/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSImmediate.h
+===================================================================
+--- qtscript.orig/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSImmediate.h 2014-02-02 00:37:23.000000000 +0400
++++ qtscript/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSImmediate.h 2014-04-28 12:02:19.681042540 +0400
+@@ -196,19 +196,43 @@
+
+ static const int32_t signBit = 0x80000000;
+
++#if OS(SOLARIS64)
++// https://bugzilla.mozilla.org/show_bug.cgi?id=577056
++// Memory layout for 64-bit Solaris is different than other 64-bit systems.
++// http://developers.sun.com/solaris/articles/solaris_memory.html
++// User space memory may locate on PART-A (0xFFFFFD80.00000000 - 0xFFFF8000.00000000)
++// and PART-B (0x00008000.00000000 - 0x00000000.04000000).
++ static ALWAYS_INLINE bool isSolaris64StackPointer(JSValue v)
++ {
++ return ((rawValue(v) & 0xFFFF800000000000LL) == 0xFFFF800000000000LL);
++ }
++#endif
++
+ static ALWAYS_INLINE bool isImmediate(JSValue v)
+ {
++#if OS(SOLARIS64)
++ if (isSolaris64StackPointer(v))
++ return false;
++#endif
+ return rawValue(v) & TagMask;
+ }
+
+ static ALWAYS_INLINE bool isNumber(JSValue v)
+ {
++#if OS(SOLARIS64)
++ if (isSolaris64StackPointer(v))
++ return false;
++#endif
+ return rawValue(v) & TagTypeNumber;
+ }
+
+ static ALWAYS_INLINE bool isIntegerNumber(JSValue v)
+ {
+ #if USE(JSVALUE64)
++# if OS(SOLARIS64)
++ if (isSolaris64StackPointer(v))
++ return false;
++# endif
+ return (rawValue(v) & TagTypeNumber) == TagTypeNumber;
+ #else
+ return isNumber(v);
+@@ -218,23 +242,39 @@
+ #if USE(JSVALUE64)
+ static ALWAYS_INLINE bool isDouble(JSValue v)
+ {
++#if OS(SOLARIS64)
++ if (isSolaris64StackPointer(v))
++ return false;
++#endif
+ return isNumber(v) && !isIntegerNumber(v);
+ }
+ #endif
+
+ static ALWAYS_INLINE bool isPositiveIntegerNumber(JSValue v)
+ {
++#if OS(SOLARIS64)
++ if (isSolaris64StackPointer(v))
++ return false;
++#endif
+ // A single mask to check for the sign bit and the number tag all at once.
+ return (rawValue(v) & (signBit | TagTypeNumber)) == TagTypeNumber;
+ }
+
+ static ALWAYS_INLINE bool isBoolean(JSValue v)
+ {
++#if OS(SOLARIS64)
++ if (isSolaris64StackPointer(v))
++ return false;
++#endif
+ return (rawValue(v) & FullTagTypeMask) == FullTagTypeBool;
+ }
+
+ static ALWAYS_INLINE bool isUndefinedOrNull(JSValue v)
+ {
++#if OS(SOLARIS64)
++ if (isSolaris64StackPointer(v))
++ return false;
++#endif
+ // Undefined and null share the same value, bar the 'undefined' bit in the extended tag.
+ return (rawValue(v) & ~ExtendedTagBitUndefined) == FullTagTypeNull;
+ }
+@@ -254,6 +294,10 @@
+
+ static ALWAYS_INLINE bool isEitherImmediate(JSValue v1, JSValue v2)
+ {
++#if OS(SOLARIS64)
++ if (isSolaris64StackPointer(v1) && isSolaris64StackPointer(v2))
++ return false;
++#endif
+ return (rawValue(v1) | rawValue(v2)) & TagMask;
+ }
+
+@@ -265,6 +309,10 @@
+ static ALWAYS_INLINE bool areBothImmediateIntegerNumbers(JSValue v1, JSValue v2)
+ {
+ #if USE(JSVALUE64)
++# if OS(SOLARIS64)
++ if (isSolaris64StackPointer(v1) || isSolaris64StackPointer(v2))
++ return false;
++# endif
+ return (rawValue(v1) & rawValue(v2) & TagTypeNumber) == TagTypeNumber;
+ #else
+ return rawValue(v1) & rawValue(v2) & TagTypeNumber;
+Index: qtscript/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
+===================================================================
+--- qtscript.orig/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h 2014-04-28 11:52:07.408011217 +0400
++++ qtscript/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h 2014-04-28 12:02:19.685676998 +0400
+@@ -448,6 +448,9 @@
+ /* OS(SOLARIS) - Solaris */
+ #if defined(sun) || defined(__sun)
+ #define WTF_OS_SOLARIS 1
++#if defined(__LP64__)
++#define WTF_OS_SOLARIS64 1
++#endif
+ #endif
+
+ /* OS(WINCE) - Windows CE; note that for this platform OS(WINDOWS) is also defined */