summaryrefslogtreecommitdiff
path: root/debian/patches/dyson-solaris-amd64-memory-layout.patch
blob: 9c7d7e93ffc72e7b98489ac3f3f2d7387b37a6e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Index: qtwebkit/Source/JavaScriptCore/wtf/Platform.h
===================================================================
--- qtwebkit.orig/Source/JavaScriptCore/wtf/Platform.h	2013-12-10 19:58:35.228838500 +0400
+++ qtwebkit/Source/JavaScriptCore/wtf/Platform.h	2013-12-18 00:39:02.801401856 +0400
@@ -480,6 +480,19 @@
 #define WTF_OS_UNIX 1
 #endif
 
+#ifndef WTF_OS_SOLARIS_AMD64
+# if OS(SOLARIS) && CPU(X86_64)
+#  define WTF_OS_SOLARIS_AMD64 1
+# else
+#  define WTF_OS_SOLARIS_AMD64 0
+# endif
+#endif
+
+// JIT needs to be ported to solaris/amd64 memory layout:
+#if OS(SOLARIS_AMD64)
+# define ENABLE_JIT 0
+#endif
+
 /* Operating environments */
 
 /* FIXME: these are all mixes of OS, operating environment and policy choices. */
Index: qtwebkit/Source/JavaScriptCore/runtime/JSValue.h
===================================================================
--- qtwebkit.orig/Source/JavaScriptCore/runtime/JSValue.h	2011-12-25 23:12:15.000000000 +0400
+++ qtwebkit/Source/JavaScriptCore/runtime/JSValue.h	2013-12-16 19:45:12.002798264 +0400
@@ -362,6 +362,17 @@
 #endif
 
         EncodedValueDescriptor u;
+
+#if OS(SOLARIS_AMD64)
+// https://bugzilla.mozilla.org/show_bug.cgi?id=577056
+// Memory layout for 64-bit Solaris is different than other 64-bit systems.
+// User space memory may locate on PART-A (0xFFFFFD80.00000000 - 0xFFFF8000.00000000)
+// and PART-B (0x00008000.00000000 - 0x00000000.04000000).
+        ALWAYS_INLINE bool isSolarisAMD64StackPointer() const
+        {
+            return ((u.asInt64 & 0xFFFF800000000007LL) == 0xFFFF800000000000LL);
+        }
+#endif
     };
 
 #if USE(JSVALUE32_64)
Index: qtwebkit/Source/JavaScriptCore/runtime/JSValueInlineMethods.h
===================================================================
--- qtwebkit.orig/Source/JavaScriptCore/runtime/JSValueInlineMethods.h	2011-12-25 23:12:15.000000000 +0400
+++ qtwebkit/Source/JavaScriptCore/runtime/JSValueInlineMethods.h	2013-12-16 19:51:19.814996750 +0400
@@ -482,11 +482,19 @@
 
     inline bool JSValue::isCell() const
     {
+#if OS(SOLARIS_AMD64)
+        if (isSolarisAMD64StackPointer())
+            return true;
+#endif
         return !(u.asInt64 & TagMask);
     }
 
     inline bool JSValue::isInt32() const
     {
+#if OS(SOLARIS_AMD64)
+        if (isSolarisAMD64StackPointer())
+            return false;
+#endif
         return (u.asInt64 & TagTypeNumber) == TagTypeNumber;
     }
 
@@ -516,6 +524,10 @@
 
     inline bool JSValue::isNumber() const
     {
+#if OS(SOLARIS_AMD64)
+        if (isSolarisAMD64StackPointer())
+            return false;
+#endif
         return u.asInt64 & TagTypeNumber;
     }