On Tue, Nov 25, 2014 at 03:35:19PM -0000, Dmitry Shachnev wrote:
> The patch from upstream bugzilla didn’t apply (I guess it is
> against newer codebase), so we used the Fedora one.
Ok, since this hasn't been reviewed upstream yet and it only seems to
affect PPC64 I'd include it with the changes for PPC64 only.
Gustavo, Emilio, any comments?
Berto
Index: webkitgtk/Source/JavaScriptCore/heap/CopiedBlock.h
===================================================================
--- webkitgtk.orig/Source/JavaScriptCore/heap/CopiedBlock.h
+++ webkitgtk/Source/JavaScriptCore/heap/CopiedBlock.h
@@ -81,7 +81,11 @@ public:
size_t size();
size_t capacity();
+#if CPU(PPC64)
+ static const size_t blockSize = 64 * KB;
+#else
static const size_t blockSize = 32 * KB;
+#endif
bool hasWorkList();
CopyWorkList& workList();
Index: webkitgtk/Source/JavaScriptCore/interpreter/JSStack.cpp
===================================================================
--- webkitgtk.orig/Source/JavaScriptCore/interpreter/JSStack.cpp
+++ webkitgtk/Source/JavaScriptCore/interpreter/JSStack.cpp
@@ -49,7 +49,11 @@ JSStack::JSStack(VM& vm, size_t capacity
{
ASSERT(capacity && isPageAligned(capacity));
+#if CPU(PPC64)
+ m_reservation = PageReservation::reserve(roundUpAllocationSize(capacity * sizeof(Register), pageSize()), OSAllocator::JSVMStackPages);
+#else
m_reservation = PageReservation::reserve(roundUpAllocationSize(capacity * sizeof(Register), commitSize), OSAllocator::JSVMStackPages);
+#endif
updateStackLimit(highAddress());
m_commitEnd = highAddress();
@@ -78,7 +82,11 @@ 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.
+#if CPU(PPC64)
+ long delta = roundUpAllocationSize(reinterpret_cast<char*>(m_commitEnd) - reinterpret_cast<char*>(newEnd), pageSize());
+#else
long delta = roundUpAllocationSize(reinterpret_cast<char*>(m_commitEnd) - reinterpret_cast<char*>(newEnd), commitSize);
+#endif
if (reinterpret_cast<char*>(m_commitEnd) - delta <= reinterpret_cast<char*>(m_useableEnd))
return false;
@@ -134,7 +142,11 @@ void JSStack::enableErrorStackReserve()
void JSStack::disableErrorStackReserve()
{
+#if CPU(PPC64)
+ char* useableEnd = reinterpret_cast<char*>(reservationEnd()) + pageSize();
+#else
char* useableEnd = reinterpret_cast<char*>(reservationEnd()) + commitSize;
+#endif
m_useableEnd = reinterpret_cast_ptr<Register*>(useableEnd);
// By the time we get here, we are guaranteed to be destructing the last