Ignore:
Timestamp:
Jan 28, 2011, 4:35:17 PM (15 years ago)
Author:
[email protected]
Message:

https://bugs.webkit.org/show_bug.cgi?id=53352
Heavy external fragmentation in FixedVMPoolAllocator can lead to a CRASH().

Reviewed by Geoff Garen.

The FixedVMPoolAllocator currently uses a best fix policy -
switch to first fit, this is less prone to external fragmentation.

  • jit/ExecutableAllocatorFixedVMPool.cpp:

(JSC::AllocationTableSizeClass::AllocationTableSizeClass):
(JSC::AllocationTableSizeClass::blockSize):
(JSC::AllocationTableSizeClass::blockCount):
(JSC::AllocationTableSizeClass::blockAlignment):
(JSC::AllocationTableSizeClass::size):
(JSC::AllocationTableLeaf::AllocationTableLeaf):
(JSC::AllocationTableLeaf::~AllocationTableLeaf):
(JSC::AllocationTableLeaf::allocate):
(JSC::AllocationTableLeaf::free):
(JSC::AllocationTableLeaf::isEmpty):
(JSC::AllocationTableLeaf::isFull):
(JSC::AllocationTableLeaf::size):
(JSC::AllocationTableLeaf::classForSize):
(JSC::AllocationTableLeaf::dump):
(JSC::LazyAllocationTable::LazyAllocationTable):
(JSC::LazyAllocationTable::~LazyAllocationTable):
(JSC::LazyAllocationTable::allocate):
(JSC::LazyAllocationTable::free):
(JSC::LazyAllocationTable::isEmpty):
(JSC::LazyAllocationTable::isFull):
(JSC::LazyAllocationTable::size):
(JSC::LazyAllocationTable::dump):
(JSC::LazyAllocationTable::classForSize):
(JSC::AllocationTableDirectory::AllocationTableDirectory):
(JSC::AllocationTableDirectory::~AllocationTableDirectory):
(JSC::AllocationTableDirectory::allocate):
(JSC::AllocationTableDirectory::free):
(JSC::AllocationTableDirectory::isEmpty):
(JSC::AllocationTableDirectory::isFull):
(JSC::AllocationTableDirectory::size):
(JSC::AllocationTableDirectory::classForSize):
(JSC::AllocationTableDirectory::dump):
(JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
(JSC::FixedVMPoolAllocator::alloc):
(JSC::FixedVMPoolAllocator::free):
(JSC::FixedVMPoolAllocator::allocated):
(JSC::FixedVMPoolAllocator::isValid):
(JSC::FixedVMPoolAllocator::classForSize):
(JSC::FixedVMPoolAllocator::offsetToPointer):
(JSC::FixedVMPoolAllocator::pointerToOffset):
(JSC::ExecutableAllocator::committedByteCount):
(JSC::ExecutableAllocator::isValid):
(JSC::ExecutableAllocator::underMemoryPressure):
(JSC::ExecutablePool::systemAlloc):
(JSC::ExecutablePool::systemRelease):

  • wtf/PageReservation.h:

(WTF::PageReservation::PageReservation):
(WTF::PageReservation::commit):
(WTF::PageReservation::decommit):
(WTF::PageReservation::committed):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/wtf/PageReservation.h

    r76409 r77025  
    5858public:
    5959    PageReservation()
    60         : m_writable(false)
     60        : m_committed(0)
     61        , m_writable(false)
    6162        , m_executable(false)
    62 #ifndef NDEBUG
    63         , m_committed(0)
    64 #endif
    6563    {
    6664    }
     
    8482        ASSERT(contains(start, size));
    8583
    86 #ifndef NDEBUG
    8784        m_committed += size;
    88 #endif
    8985        OSAllocator::commit(start, size, m_writable, m_executable);
    9086    }
     
    9793        ASSERT(contains(start, size));
    9894
    99 #ifndef NDEBUG
    10095        m_committed -= size;
    101 #endif
    10296        OSAllocator::decommit(start, size);
     97    }
     98
     99    size_t committed()
     100    {
     101        return m_committed;
    103102    }
    104103
     
    127126    PageReservation(void* base, size_t size, bool writable, bool executable)
    128127        : PageBlock(base, size)
     128        , m_committed(0)
    129129        , m_writable(writable)
    130130        , m_executable(executable)
    131 #ifndef NDEBUG
    132         , m_committed(0)
    133 #endif
    134131    {
    135132    }
    136133
     134    size_t m_committed;
    137135    bool m_writable;
    138136    bool m_executable;
    139 #ifndef NDEBUG
    140     size_t m_committed;
    141 #endif
    142137};
    143138
Note: See TracChangeset for help on using the changeset viewer.