Ignore:
Timestamp:
Jan 18, 2013, 12:49:58 PM (12 years ago)
Author:
[email protected]
Message:

r134080 causes heap problem on linux systems where PAGESIZE != 4096
https://bugs.webkit.org/show_bug.cgi?id=102828

Patch by Balazs Kilvady <[email protected]> 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):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/MarkStack.cpp

    r134080 r140195  
    3232#include "CopiedSpaceInlines.h"
    3333#include "Heap.h"
    34 #include "Options.h"
    3534#include "JSArray.h"
    3635#include "JSCell.h"
     
    4645namespace JSC {
    4746
     47COMPILE_ASSERT(MarkStackSegment::blockSize == WeakBlock::blockSize, blockSizeMatch);
     48
    4849MarkStackArray::MarkStackArray(BlockAllocator& blockAllocator)
    4950    : m_blockAllocator(blockAllocator)
    50     , m_segmentCapacity(MarkStackSegment::capacityFromSize(Options::gcMarkStackSegmentSize()))
    5151    , m_top(0)
    5252    , m_numberOfSegments(0)
    5353{
    54     ASSERT(MarkStackSegment::blockSize == WeakBlock::blockSize);
    5554    m_segments.push(MarkStackSegment::create(m_blockAllocator.allocate<MarkStackSegment>()));
    5655    m_numberOfSegments++;
     
    6564void MarkStackArray::expand()
    6665{
    67     ASSERT(m_segments.head()->m_top == m_segmentCapacity);
     66    ASSERT(m_segments.head()->m_top == s_segmentCapacity);
    6867   
    6968    MarkStackSegment* nextSegment = MarkStackSegment::create(m_blockAllocator.allocate<MarkStackSegment>());
     
    9796    // we prefer donating whole segments over donating individual cells,
    9897    // even if this skews away from our 1 / 2 target.
    99 
    100     ASSERT(m_segmentCapacity == other.m_segmentCapacity);
    10198
    10299    size_t segmentsToDonate = m_numberOfSegments / 2; // If we only have one segment (our head) we don't donate any segments.
     
    142139    // individual cells, even if this skews away from our 1 / N target.
    143140
    144     ASSERT(m_segmentCapacity == other.m_segmentCapacity);
    145141    validatePrevious();
    146142    other.validatePrevious();
     
    152148        MarkStackSegment* myHead = m_segments.removeHead();
    153149
    154         ASSERT(other.m_segments.head()->m_top == m_segmentCapacity);
     150        ASSERT(other.m_segments.head()->m_top == s_segmentCapacity);
    155151
    156152        m_segments.push(other.m_segments.removeHead());
Note: See TracChangeset for help on using the changeset viewer.