[webkitgtk3] Add support for ppc64le Fix for CLoop on ppc64, ppc64le and s390x

Tomas Popela tpopela at fedoraproject.org
Wed May 14 14:52:06 UTC 2014


commit 769a1f3710fb68105c9cff782af2f7d4221627d6
Author: Tomas Popela <tpopela at redhat.com>
Date:   Wed May 14 16:51:33 2014 +0200

    Add support for ppc64le
    Fix for CLoop on ppc64, ppc64le and s390x

 webkitgtk-2.4.1-cloop_fix.patch   |  138 +++++++++++++++++++++++++++++++++++++
 webkitgtk-2.4.1-ppc64_align.patch |   45 ++++++++++++
 webkitgtk-2.4.2-ppc64le.patch     |   69 ++++++++++++++++++
 webkitgtk3.spec                   |   22 +++++-
 4 files changed, 271 insertions(+), 3 deletions(-)
---
diff --git a/webkitgtk-2.4.1-cloop_fix.patch b/webkitgtk-2.4.1-cloop_fix.patch
new file mode 100644
index 0000000..c5d9668
--- /dev/null
+++ b/webkitgtk-2.4.1-cloop_fix.patch
@@ -0,0 +1,138 @@
+diff -up webkitgtk-2.4.1/Source/JavaScriptCore/interpreter/ProtoCallFrame.h.cloop_fix webkitgtk-2.4.1/Source/JavaScriptCore/interpreter/ProtoCallFrame.h
+--- webkitgtk-2.4.1/Source/JavaScriptCore/interpreter/ProtoCallFrame.h.cloop_fix	2014-04-14 08:40:44.000000000 +0200
++++ webkitgtk-2.4.1/Source/JavaScriptCore/interpreter/ProtoCallFrame.h	2014-04-30 16:10:49.120156216 +0200
+@@ -36,7 +36,7 @@ struct ProtoCallFrame {
+     Register calleeValue;
+     Register argCountAndCodeOriginValue;
+     Register thisArg;
+-    size_t paddedArgCount;
++    uint32_t paddedArgCount;
+     JSValue *args;
+ 
+     void init(CodeBlock*, JSScope*, JSObject*, JSValue, int, JSValue* otherArgs = 0);
+@@ -53,7 +53,7 @@ struct ProtoCallFrame {
+     int argumentCountIncludingThis() const { return argCountAndCodeOriginValue.payload(); }
+     int argumentCount() const { return argumentCountIncludingThis() - 1; }
+     void setArgumentCountIncludingThis(int count) { argCountAndCodeOriginValue.payload() = count; }
+-    void setPaddedArgsCount(size_t argCount) { paddedArgCount = argCount; }
++    void setPaddedArgsCount(uint32_t argCount) { paddedArgCount = argCount; }
+ 
+     void clearCurrentVPC() { argCountAndCodeOriginValue.tag() = 0; }
+     
+diff -up webkitgtk-2.4.1/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp.cloop_fix webkitgtk-2.4.1/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
+--- webkitgtk-2.4.1/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp.cloop_fix	2014-04-30 16:11:18.457540050 +0200
++++ webkitgtk-2.4.1/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp	2014-04-30 16:11:50.944965101 +0200
+@@ -1354,7 +1354,7 @@ LLINT_SLOW_PATH_DECL(slow_path_get_from_
+             CodeBlock* codeBlock = exec->codeBlock();
+             ConcurrentJITLocker locker(codeBlock->m_lock);
+             pc[5].u.structure.set(exec->vm(), codeBlock->ownerExecutable(), scope->structure());
+-            pc[6].u.operand = slot.cachedOffset();
++            pc[6].u.pointer = reinterpret_cast<void*>(slot.cachedOffset());
+         }
+     }
+ 
+@@ -1381,7 +1381,7 @@ LLINT_SLOW_PATH_DECL(slow_path_put_to_sc
+         if (slot.isCacheable() && slot.base() == scope && scope->structure()->propertyAccessesAreCacheable()) {
+             ConcurrentJITLocker locker(codeBlock->m_lock);
+             pc[5].u.structure.set(exec->vm(), codeBlock->ownerExecutable(), scope->structure());
+-            pc[6].u.operand = slot.cachedOffset();
++            pc[6].u.pointer = reinterpret_cast<void*>(slot.cachedOffset());
+         }
+     }
+ 
+diff -up webkitgtk-2.4.1/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm.cloop_fix webkitgtk-2.4.1/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
+--- webkitgtk-2.4.1/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm.cloop_fix	2014-04-14 08:40:44.000000000 +0200
++++ webkitgtk-2.4.1/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm	2014-04-30 16:12:35.648549985 +0200
+@@ -282,7 +282,7 @@ macro doCallToJavaScript(makeCall, doRet
+     storep temp3, CodeBlock+4[cfr, temp1, 8]
+     btinz temp1, .copyHeaderLoop
+ 
+-    loadi ProtoCallFrame::argCountAndCodeOriginValue[protoCallFrame], temp2
++    loadi PayloadOffset + ProtoCallFrame::argCountAndCodeOriginValue[protoCallFrame], temp2
+     subi 1, temp2
+     loadi ProtoCallFrame::paddedArgCount[protoCallFrame], temp3
+     subi 1, temp3
+@@ -2277,7 +2277,7 @@ macro loadWithStructureCheck(operand, sl
+ end
+ 
+ macro getProperty()
+-    loadisFromInstruction(6, t3)
++    loadpFromInstruction(6, t3)
+     loadPropertyAtVariableOffset(t3, t0, t1, t2)
+     valueProfile(t1, t2, 28, t0)
+     loadisFromInstruction(1, t0)
+@@ -2297,7 +2297,7 @@ end
+ 
+ macro getClosureVar()
+     loadp JSVariableObject::m_registers[t0], t0
+-    loadisFromInstruction(6, t3)
++    loadpFromInstruction(6, t3)
+     loadp TagOffset[t0, t3, 8], t1
+     loadp PayloadOffset[t0, t3, 8], t2
+     valueProfile(t1, t2, 28, t0)
+@@ -2356,7 +2356,7 @@ _llint_op_get_from_scope:
+ macro putProperty()
+     loadisFromInstruction(3, t1)
+     loadConstantOrVariable(t1, t2, t3)
+-    loadisFromInstruction(6, t1)
++    loadpFromInstruction(6, t1)
+     storePropertyAtVariableOffset(t1, t0, t2, t3)
+ end
+ 
+@@ -2374,7 +2374,7 @@ macro putClosureVar()
+     loadisFromInstruction(3, t1)
+     loadConstantOrVariable(t1, t2, t3)
+     loadp JSVariableObject::m_registers[t0], t0
+-    loadisFromInstruction(6, t1)
++    loadpFromInstruction(6, t1)
+     storei t2, TagOffset[t0, t1, 8]
+     storei t3, PayloadOffset[t0, t1, 8]
+ end
+diff -up webkitgtk-2.4.1/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm.cloop_fix webkitgtk-2.4.1/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
+--- webkitgtk-2.4.1/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm.cloop_fix	2014-04-14 08:40:44.000000000 +0200
++++ webkitgtk-2.4.1/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm	2014-04-30 16:10:49.121156229 +0200
+@@ -171,7 +171,7 @@ macro doCallToJavaScript(makeCall, doRet
+     storep temp3, CodeBlock[cfr, temp1, 8]
+     btinz temp1, .copyHeaderLoop
+ 
+-    loadi ProtoCallFrame::argCountAndCodeOriginValue[protoCallFrame], temp2
++    loadi PayloadOffset + ProtoCallFrame::argCountAndCodeOriginValue[protoCallFrame], temp2
+     subi 1, temp2
+     loadi ProtoCallFrame::paddedArgCount[protoCallFrame], temp3
+     subi 1, temp3
+@@ -2047,7 +2047,7 @@ macro loadWithStructureCheck(operand, sl
+ end
+ 
+ macro getProperty()
+-    loadisFromInstruction(6, t1)
++    loadpFromInstruction(6, t1)
+     loadPropertyAtVariableOffset(t1, t0, t2)
+     valueProfile(t2, 7, t0)
+     loadisFromInstruction(1, t0)
+@@ -2064,7 +2064,7 @@ end
+ 
+ macro getClosureVar()
+     loadp JSVariableObject::m_registers[t0], t0
+-    loadisFromInstruction(6, t1)
++    loadpFromInstruction(6, t1)
+     loadq [t0, t1, 8], t0
+     valueProfile(t0, 7, t1)
+     loadisFromInstruction(1, t1)
+@@ -2121,7 +2121,7 @@ _llint_op_get_from_scope:
+ macro putProperty()
+     loadisFromInstruction(3, t1)
+     loadConstantOrVariable(t1, t2)
+-    loadisFromInstruction(6, t1)
++    loadpFromInstruction(6, t1)
+     storePropertyAtVariableOffset(t1, t0, t2)
+ end
+ 
+@@ -2138,7 +2138,7 @@ macro putClosureVar()
+     loadisFromInstruction(3, t1)
+     loadConstantOrVariable(t1, t2)
+     loadp JSVariableObject::m_registers[t0], t0
+-    loadisFromInstruction(6, t1)
++    loadpFromInstruction(6, t1)
+     storeq t2, [t0, t1, 8]
+ end
+ 
diff --git a/webkitgtk-2.4.1-ppc64_align.patch b/webkitgtk-2.4.1-ppc64_align.patch
new file mode 100644
index 0000000..5186d60
--- /dev/null
+++ b/webkitgtk-2.4.1-ppc64_align.patch
@@ -0,0 +1,45 @@
+diff -up webkitgtk-2.4.2/Source/JavaScriptCore/heap/CopiedBlock.h.ppc64_align webkitgtk-2.4.2/Source/JavaScriptCore/heap/CopiedBlock.h
+--- webkitgtk-2.4.2/Source/JavaScriptCore/heap/CopiedBlock.h.ppc64_align	2014-05-12 08:03:53.000000000 +0200
++++ webkitgtk-2.4.2/Source/JavaScriptCore/heap/CopiedBlock.h	2014-05-14 15:16:36.946318596 +0200
+@@ -81,7 +81,7 @@ public:
+     size_t size();
+     size_t capacity();
+ 
+-    static const size_t blockSize = 32 * KB;
++    static const size_t blockSize = 64 * KB;
+ 
+     bool hasWorkList();
+     CopyWorkList& workList();
+diff -up webkitgtk-2.4.2/Source/JavaScriptCore/interpreter/JSStack.cpp.ppc64_align webkitgtk-2.4.2/Source/JavaScriptCore/interpreter/JSStack.cpp
+--- webkitgtk-2.4.2/Source/JavaScriptCore/interpreter/JSStack.cpp.ppc64_align	2014-05-12 08:03:53.000000000 +0200
++++ webkitgtk-2.4.2/Source/JavaScriptCore/interpreter/JSStack.cpp	2014-05-14 15:17:35.617171141 +0200
+@@ -49,7 +49,8 @@ JSStack::JSStack(VM& vm, size_t capacity
+ {
+     ASSERT(capacity && isPageAligned(capacity));
+ 
+-    m_reservation = PageReservation::reserve(roundUpAllocationSize(capacity * sizeof(Register), commitSize), OSAllocator::JSVMStackPages);
++    size_t commitsize = pageSize();
++    m_reservation = PageReservation::reserve(roundUpAllocationSize(capacity * sizeof(Register), commitsize), OSAllocator::JSVMStackPages);
+     updateStackLimit(highAddress());
+     m_commitEnd = highAddress();
+ 
+@@ -78,7 +79,8 @@ bool JSStack::growSlowCase(Register* new
+     // Compute the chunk size of additional memory to commit, and see if we
+     // have it is still within our budget. If not, we'll fail to grow and
+     // return false.
+-    long delta = roundUpAllocationSize(reinterpret_cast<char*>(m_commitEnd) - reinterpret_cast<char*>(newEnd), commitSize);
++    size_t commitsize = pageSize();
++    long delta = roundUpAllocationSize(reinterpret_cast<char*>(m_commitEnd) - reinterpret_cast<char*>(newEnd), commitsize);
+     if (reinterpret_cast<char*>(m_commitEnd) - delta <= reinterpret_cast<char*>(m_useableEnd))
+         return false;
+ 
+@@ -134,7 +136,8 @@ void JSStack::enableErrorStackReserve()
+ 
+ void JSStack::disableErrorStackReserve()
+ {
+-    char* useableEnd = reinterpret_cast<char*>(reservationEnd()) + commitSize;
++    size_t commitsize = pageSize();
++    char* useableEnd = reinterpret_cast<char*>(reservationEnd()) + commitsize;
+     m_useableEnd = reinterpret_cast_ptr<Register*>(useableEnd);
+ 
+     // By the time we get here, we are guaranteed to be destructing the last
diff --git a/webkitgtk-2.4.2-ppc64le.patch b/webkitgtk-2.4.2-ppc64le.patch
new file mode 100644
index 0000000..3618d98
--- /dev/null
+++ b/webkitgtk-2.4.2-ppc64le.patch
@@ -0,0 +1,69 @@
+diff -up webkitgtk-2.4.2/Source/WTF/wtf/dtoa/utils.h.ppc64le webkitgtk-2.4.2/Source/WTF/wtf/dtoa/utils.h
+--- webkitgtk-2.4.2/Source/WTF/wtf/dtoa/utils.h.ppc64le	2014-05-14 15:37:26.360159487 +0200
++++ webkitgtk-2.4.2/Source/WTF/wtf/dtoa/utils.h	2014-05-14 15:38:46.938315499 +0200
+@@ -49,7 +49,7 @@
+ defined(__ARMEL__) || \
+ defined(_MIPS_ARCH_MIPS32R2)
+ #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
+-#elif CPU(MIPS) || CPU(PPC) || CPU(PPC64) || OS(WINCE) || CPU(SH4) || CPU(S390) || CPU(S390X) || CPU(IA64) || CPU(ALPHA) || CPU(ARM64) || CPU(HPPA)
++#elif CPU(MIPS) || CPU(PPC) || CPU(PPC64) || CPU(PPC64LE) || OS(WINCE) || CPU(SH4) || CPU(S390) || CPU(S390X) || CPU(IA64) || CPU(ALPHA) || CPU(ARM64) || CPU(HPPA)
+ #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
+ #elif defined(_M_IX86) || defined(__i386__)
+ #if defined(_WIN32)
+diff -up webkitgtk-2.4.2/Source/WTF/wtf/Platform.h.ppc64le webkitgtk-2.4.2/Source/WTF/wtf/Platform.h
+--- webkitgtk-2.4.2/Source/WTF/wtf/Platform.h.ppc64le	2014-05-12 08:03:53.000000000 +0200
++++ webkitgtk-2.4.2/Source/WTF/wtf/Platform.h	2014-05-14 15:39:08.402622454 +0200
+@@ -101,24 +101,38 @@
+ #endif /* MIPS */
+ 
+ /* CPU(PPC) - PowerPC 32-bit */
+-#if   defined(__ppc__)     \
++#if (  defined(__ppc__)     \
+     || defined(__PPC__)     \
+     || defined(__powerpc__) \
+     || defined(__powerpc)   \
+     || defined(__POWERPC__) \
+     || defined(_M_PPC)      \
+-    || defined(__PPC)
++    || defined(__PPC)) \
++    && defined(__BYTE_ORDER__) \
++    && (__BYTE_ORDER__==__ORDER_BIG_ENDIAN__)
+ #define WTF_CPU_PPC 1
+ #define WTF_CPU_BIG_ENDIAN 1
+ #endif
+ 
+-/* CPU(PPC64) - PowerPC 64-bit */
+-#if   defined(__ppc64__) \
+-    || defined(__PPC64__)
++/* CPU(PPC64) - PowerPC 64-bit Big Endian */
++#if (  defined(__ppc64__) \
++    || defined(__PPC64__)) \
++    && defined(__BYTE_ORDER__) \
++    && (__BYTE_ORDER__==__ORDER_BIG_ENDIAN__)
+ #define WTF_CPU_PPC64 1
+ #define WTF_CPU_BIG_ENDIAN 1
+ #endif
+ 
++/* CPU(PPC64) - PowerPC 64-bit Little Endian */
++#if (   defined(__ppc64__) \
++    || defined(__PPC64__) \
++    || defined(__ppc64le__) \
++    || defined(__PPC64LE__)) \
++    && defined(__BYTE_ORDER__) \
++    && (__BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__)
++#define WTF_CPU_PPC64LE 1
++#endif
++
+ /* CPU(SH4) - SuperH SH-4 */
+ #if defined(__SH4__)
+ #define WTF_CPU_SH4 1
+@@ -641,7 +655,8 @@
+     || CPU(ALPHA) \
+     || CPU(ARM64) \
+     || CPU(S390X) \
+-    || CPU(PPC64)
++    || CPU(PPC64) \
++    || CPU(PPC64LE)
+ #define WTF_USE_JSVALUE64 1
+ #else
+ #define WTF_USE_JSVALUE32_64 1
diff --git a/webkitgtk3.spec b/webkitgtk3.spec
index 1459d5a..61eebb2 100644
--- a/webkitgtk3.spec
+++ b/webkitgtk3.spec
@@ -7,7 +7,7 @@
 
 Name:           webkitgtk3
 Version:        2.4.2
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        GTK+ Web content engine library
 
 Group:          Development/Libraries
@@ -20,6 +20,9 @@ Patch0:         webkit-1.1.14-nspluginwrapper.patch
 # https://bugs.webkit.org/show_bug.cgi?id=103128
 Patch4:         webkit-2.1.90-double2intsPPC32.patch
 Patch10:        webkitgtk-aarch64.patch
+Patch11:        webkitgtk-2.4.1-cloop_fix.patch
+Patch12:        webkitgtk-2.4.1-ppc64_align.patch
+Patch13:        webkitgtk-2.4.2-ppc64le.patch
 
 BuildRequires:  at-spi2-core-devel
 BuildRequires:  bison
@@ -99,7 +102,16 @@ This package contains developer documentation for %{name}.
 %ifarch ppc s390
 %patch4 -p1 -b .double2intsPPC32
 %endif
+%ifarch aarch64
 %patch10 -p1 -b .aarch64
+%endif
+%ifarch %{power64} s390x
+%patch11 -p1 -b .cloop_fix
+%endif
+%ifarch %{power64}
+%patch12 -p1 -b .ppc64_align
+%endif
+%patch13 -p1 -b .ppc64le
 
 %build
 # Use linker flags to reduce memory consumption
@@ -115,13 +127,13 @@ This package contains developer documentation for %{name}.
 %global optflags %{optflags} -Wl,-relax -latomic
 %endif
 
-%ifarch s390 s390x ppc ppc64 aarch64
+%ifarch s390 s390x ppc %{power64} aarch64
 %global optflags %{optflags} -DENABLE_YARR_JIT=0
 %endif
 
 %configure                                                      \
                         --with-gtk=3.0                          \
-%ifarch s390 s390x ppc ppc64 aarch64
+%ifarch s390 s390x ppc %{power64} aarch64
                         --disable-jit                           \
 %else
                         --enable-jit                            \
@@ -223,6 +235,10 @@ find $RPM_BUILD_ROOT%{_libdir} -name "*.la" -delete
 %{_datadir}/gtk-doc/html/webkitdomgtk
 
 %changelog
+* Wed May 14 2014 Tomas Popela <tpopela at redhat.com> 2.4.2-3
+- Add support for ppc64le
+- Fix for CLoop on ppc64, ppc64le and s390x
+
 * Tue May 13 2014 Karsten Hopp <karsten at redhat.com> 2.4.2-2
 - PPC (32bit) needs libatomic in the buildroot
 


More information about the scm-commits mailing list