Changeset 95512 in webkit


Ignore:
Timestamp:
Sep 19, 2011, 9:05:28 PM (14 years ago)
Author:
ggaren@apple.com
Message:

Removed ENABLE_LAZY_BLOCK_FREEING and related #ifdefs
https://bugs.webkit.org/show_bug.cgi?id=68424

As discussed on webkit-dev. All ports build with threads enabled in JSC now.

This may break WinCE and other ports that have not built and tested with
this configuration. I've filed bugs for port maintainers. It's time for
WebKit to move forward.

Reviewed by Mark Rowe.

  • heap/Heap.cpp:

(JSC::Heap::Heap):
(JSC::Heap::~Heap):
(JSC::Heap::destroy):
(JSC::Heap::blockFreeingThreadMain):
(JSC::Heap::allocateBlock):
(JSC::Heap::freeBlocks):
(JSC::Heap::releaseFreeBlocks):

  • heap/Heap.h:
  • wtf/Platform.h:
Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r95511 r95512  
     12011-09-19  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Removed ENABLE_LAZY_BLOCK_FREEING and related #ifdefs
     4        https://bugs.webkit.org/show_bug.cgi?id=68424
     5
     6        As discussed on webkit-dev. All ports build with threads enabled in JSC now.
     7       
     8        This may break WinCE and other ports that have not built and tested with
     9        this configuration. I've filed bugs for port maintainers. It's time for
     10        WebKit to move forward.
     11
     12        Reviewed by Mark Rowe.
     13
     14        * heap/Heap.cpp:
     15        (JSC::Heap::Heap):
     16        (JSC::Heap::~Heap):
     17        (JSC::Heap::destroy):
     18        (JSC::Heap::blockFreeingThreadMain):
     19        (JSC::Heap::allocateBlock):
     20        (JSC::Heap::freeBlocks):
     21        (JSC::Heap::releaseFreeBlocks):
     22        * heap/Heap.h:
     23        * wtf/Platform.h:
     24
    1252011-09-19  Geoffrey Garen  <ggaren@apple.com>
    226
  • trunk/Source/JavaScriptCore/heap/Heap.cpp

    r95507 r95512  
    262262    m_markedSpace.setHighWaterMark(m_minBytesPerCycle);
    263263    (*m_activityCallback)();
    264 #if ENABLE(LAZY_BLOCK_FREEING)
    265264    m_numberOfFreeBlocks = 0;
    266265    m_blockFreeingThread = createThread(blockFreeingThreadStartFunc, this, "JavaScriptCore::BlockFree");
    267266    ASSERT(m_blockFreeingThread);
    268 #endif
    269267}
    270268
    271269Heap::~Heap()
    272270{
    273 #if ENABLE(LAZY_BLOCK_FREEING)
    274271    // destroy our thread
    275272    {
     
    279276    }
    280277    waitForThreadCompletion(m_blockFreeingThread, 0);
    281 #endif
    282278   
    283279    // The destroy function must already have been called, so assert this.
     
    318314#endif
    319315   
    320 #if ENABLE(LAZY_BLOCK_FREEING)
    321316    releaseFreeBlocks();
    322 #endif
    323317
    324318    m_globalData = 0;
    325319}
    326320
    327 #if ENABLE(LAZY_BLOCK_FREEING)
    328321void Heap::waitForRelativeTimeWhileHoldingLock(double relative)
    329322{
     
    387380    }
    388381}
    389 #endif // ENABLE(LAZY_BLOCK_FREEING)
    390382
    391383void Heap::reportExtraMemoryCostSlowCase(size_t cost)
     
    737729    MarkedBlock* block;
    738730   
    739 #if !ENABLE(LAZY_BLOCK_FREEING)
    740     if (allocationEffort == AllocationCanFail)
    741         return 0;
    742    
    743     block = MarkedBlock::create(this, cellSize);
    744 #else
    745731    {
    746732        MutexLocker locker(m_freeBlockLock);
     
    758744    else
    759745        block = MarkedBlock::create(this, cellSize);
    760 #endif
    761746   
    762747    m_blocks.add(block);
     
    773758        m_blocks.remove(block);
    774759        block->reset();
    775 #if !ENABLE(LAZY_BLOCK_FREEING)
    776         MarkedBlock::destroy(block);
    777 #else
    778760        MutexLocker locker(m_freeBlockLock);
    779761        m_freeBlocks.append(block);
    780762        m_numberOfFreeBlocks++;
    781 #endif
    782763    }
    783764}
     
    790771}
    791772
    792 #if ENABLE(LAZY_BLOCK_FREEING)
    793773void Heap::releaseFreeBlocks()
    794774{
     
    812792    }
    813793}
    814 #endif
    815794
    816795#if ENABLE(GGC)
  • trunk/Source/JavaScriptCore/heap/Heap.h

    r95507 r95512  
    165165        static void writeBarrierSlowCase(const JSCell*, JSCell*);
    166166
    167 #if ENABLE(LAZY_BLOCK_FREEING)
    168167        void waitForRelativeTimeWhileHoldingLock(double relative);
    169168        void waitForRelativeTime(double relative);
    170169        void blockFreeingThreadMain();
    171170        static void* blockFreeingThreadStartFunc(void* heap);
    172 #endif
    173171
    174172        const HeapSize m_heapSize;
     
    179177        MarkedBlockSet m_blocks;
    180178
    181 #if ENABLE(LAZY_BLOCK_FREEING)
    182179        DoublyLinkedList<MarkedBlock> m_freeBlocks;
    183180        size_t m_numberOfFreeBlocks;
     
    187184        ThreadCondition m_freeBlockCondition;
    188185        bool m_blockFreeingThreadShouldQuit;
    189 #endif
    190186
    191187#if ENABLE(SIMPLE_HEAP_PROFILING)
  • trunk/Source/JavaScriptCore/wtf/Platform.h

    r95511 r95512  
    10361036#endif
    10371037
    1038 #if !defined(ENABLE_LAZY_BLOCK_FREEING)
    1039 #define ENABLE_LAZY_BLOCK_FREEING 1
    1040 #endif
    1041 
    10421038#ifndef ENABLE_LARGE_HEAP
    10431039#if CPU(X86) || CPU(X86_64)
Note: See TracChangeset for help on using the changeset viewer.