From 6ab46a19bac261f42b664c62f8c2477b294b86ea Mon Sep 17 00:00:00 2001 From: Balazs Kilvady Date: Thu, 4 Apr 2013 13:51:09 +0200 Subject: r134080 causes heap problem on linux systems where PAGESIZE != 4096 https://bugs.webkit.org/show_bug.cgi?id=102828 Patch by Balazs Kilvady on 2013-01-18 Reviewed by Mark Hahnenberg. Make MarkStackSegment::blockSize as the capacity of segments of a MarkStackArray. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreExports.def: * heap/MarkStack.cpp: (JSC): (JSC::MarkStackArray::MarkStackArray): (JSC::MarkStackArray::expand): (JSC::MarkStackArray::donateSomeCellsTo): (JSC::MarkStackArray::stealSomeCellsFrom): * heap/MarkStack.h: (JSC::MarkStackSegment::data): (CapacityFromSize): (MarkStackArray): * heap/MarkStackInlines.h: (JSC::MarkStackArray::setTopForFullSegment): (JSC::MarkStackArray::append): (JSC::MarkStackArray::isEmpty): (JSC::MarkStackArray::size): * runtime/Options.h: (JSC): Change-Id: I4663100b6b8b054bed03c0c6eb01bb9274a1b264 git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140195 268f45cc-cd09-0410-ab3c-d52691b4dbfc Reviewed-by: Jocelyn Turcotte --- Source/JavaScriptCore/heap/MarkStackInlines.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/JavaScriptCore/heap/MarkStackInlines.h') diff --git a/Source/JavaScriptCore/heap/MarkStackInlines.h b/Source/JavaScriptCore/heap/MarkStackInlines.h index 1595e843e..c577de602 100644 --- a/Source/JavaScriptCore/heap/MarkStackInlines.h +++ b/Source/JavaScriptCore/heap/MarkStackInlines.h @@ -52,8 +52,8 @@ inline size_t MarkStackArray::preDecTop() inline void MarkStackArray::setTopForFullSegment() { - ASSERT(m_segments.head()->m_top == m_segmentCapacity); - m_top = m_segmentCapacity; + ASSERT(m_segments.head()->m_top == s_segmentCapacity); + m_top = s_segmentCapacity; } inline void MarkStackArray::setTopForEmptySegment() @@ -82,7 +82,7 @@ inline void MarkStackArray::validatePrevious() inline void MarkStackArray::append(const JSCell* cell) { - if (m_top == m_segmentCapacity) + if (m_top == s_segmentCapacity) expand(); m_segments.head()->data()[postIncTop()] = cell; } @@ -102,7 +102,7 @@ inline bool MarkStackArray::isEmpty() if (m_top) return false; if (m_segments.head()->next()) { - ASSERT(m_segments.head()->next()->m_top == m_segmentCapacity); + ASSERT(m_segments.head()->next()->m_top == s_segmentCapacity); return false; } return true; @@ -110,7 +110,7 @@ inline bool MarkStackArray::isEmpty() inline size_t MarkStackArray::size() { - return m_top + m_segmentCapacity * (m_numberOfSegments - 1); + return m_top + s_segmentCapacity * (m_numberOfSegments - 1); } } // namespace JSC -- cgit v1.2.1