Title: [95512] trunk/Source/_javascript_Core
Revision
95512
Author
gga...@apple.com
Date
2011-09-19 21:05:28 -0700 (Mon, 19 Sep 2011)

Log 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:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (95511 => 95512)


--- trunk/Source/_javascript_Core/ChangeLog	2011-09-20 03:55:29 UTC (rev 95511)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-09-20 04:05:28 UTC (rev 95512)
@@ -1,5 +1,29 @@
 2011-09-19  Geoffrey Garen  <gga...@apple.com>
 
+        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:
+
+2011-09-19  Geoffrey Garen  <gga...@apple.com>
+
         Removed ENABLE_WTF_MULTIPLE_THREADS and related #ifdefs
         https://bugs.webkit.org/show_bug.cgi?id=68423
 

Modified: trunk/Source/_javascript_Core/heap/Heap.cpp (95511 => 95512)


--- trunk/Source/_javascript_Core/heap/Heap.cpp	2011-09-20 03:55:29 UTC (rev 95511)
+++ trunk/Source/_javascript_Core/heap/Heap.cpp	2011-09-20 04:05:28 UTC (rev 95512)
@@ -261,16 +261,13 @@
 {
     m_markedSpace.setHighWaterMark(m_minBytesPerCycle);
     (*m_activityCallback)();
-#if ENABLE(LAZY_BLOCK_FREEING)
     m_numberOfFreeBlocks = 0;
     m_blockFreeingThread = createThread(blockFreeingThreadStartFunc, this, "_javascript_Core::BlockFree");
     ASSERT(m_blockFreeingThread);
-#endif
 }
 
 Heap::~Heap()
 {
-#if ENABLE(LAZY_BLOCK_FREEING)
     // destroy our thread
     {
         MutexLocker locker(m_freeBlockLock);
@@ -278,7 +275,6 @@
         m_freeBlockCondition.broadcast();
     }
     waitForThreadCompletion(m_blockFreeingThread, 0);
-#endif
     
     // The destroy function must already have been called, so assert this.
     ASSERT(!m_globalData);
@@ -317,14 +313,11 @@
     m_destroyedTypeCounts.dump(stderr, "Destroyed Type Counts");
 #endif
     
-#if ENABLE(LAZY_BLOCK_FREEING)
     releaseFreeBlocks();
-#endif
 
     m_globalData = 0;
 }
 
-#if ENABLE(LAZY_BLOCK_FREEING)
 void Heap::waitForRelativeTimeWhileHoldingLock(double relative)
 {
     if (m_blockFreeingThreadShouldQuit)
@@ -386,7 +379,6 @@
         }
     }
 }
-#endif // ENABLE(LAZY_BLOCK_FREEING)
 
 void Heap::reportExtraMemoryCostSlowCase(size_t cost)
 {
@@ -736,12 +728,6 @@
 {
     MarkedBlock* block;
     
-#if !ENABLE(LAZY_BLOCK_FREEING)
-    if (allocationEffort == AllocationCanFail)
-        return 0;
-    
-    block = MarkedBlock::create(this, cellSize);
-#else
     {
         MutexLocker locker(m_freeBlockLock);
         if (m_numberOfFreeBlocks) {
@@ -757,7 +743,6 @@
         return 0;
     else
         block = MarkedBlock::create(this, cellSize);
-#endif
     
     m_blocks.add(block);
 
@@ -772,13 +757,9 @@
 
         m_blocks.remove(block);
         block->reset();
-#if !ENABLE(LAZY_BLOCK_FREEING)
-        MarkedBlock::destroy(block);
-#else
         MutexLocker locker(m_freeBlockLock);
         m_freeBlocks.append(block);
         m_numberOfFreeBlocks++;
-#endif
     }
 }
 
@@ -789,7 +770,6 @@
     freeBlocks(forEachBlock(takeIfEmpty));
 }
 
-#if ENABLE(LAZY_BLOCK_FREEING)
 void Heap::releaseFreeBlocks()
 {
     while (true) {
@@ -811,7 +791,6 @@
         MarkedBlock::destroy(block);
     }
 }
-#endif
 
 #if ENABLE(GGC)
 void Heap::writeBarrierSlowCase(const JSCell* owner, JSCell* cell)

Modified: trunk/Source/_javascript_Core/heap/Heap.h (95511 => 95512)


--- trunk/Source/_javascript_Core/heap/Heap.h	2011-09-20 03:55:29 UTC (rev 95511)
+++ trunk/Source/_javascript_Core/heap/Heap.h	2011-09-20 04:05:28 UTC (rev 95512)
@@ -164,12 +164,10 @@
 
         static void writeBarrierSlowCase(const JSCell*, JSCell*);
 
-#if ENABLE(LAZY_BLOCK_FREEING)
         void waitForRelativeTimeWhileHoldingLock(double relative);
         void waitForRelativeTime(double relative);
         void blockFreeingThreadMain();
         static void* blockFreeingThreadStartFunc(void* heap);
-#endif
 
         const HeapSize m_heapSize;
         const size_t m_minBytesPerCycle;
@@ -178,7 +176,6 @@
         MarkedSpace m_markedSpace;
         MarkedBlockSet m_blocks;
 
-#if ENABLE(LAZY_BLOCK_FREEING)
         DoublyLinkedList<MarkedBlock> m_freeBlocks;
         size_t m_numberOfFreeBlocks;
         
@@ -186,7 +183,6 @@
         Mutex m_freeBlockLock;
         ThreadCondition m_freeBlockCondition;
         bool m_blockFreeingThreadShouldQuit;
-#endif
 
 #if ENABLE(SIMPLE_HEAP_PROFILING)
         VTableSpectrum m_destroyedTypeCounts;

Modified: trunk/Source/_javascript_Core/wtf/Platform.h (95511 => 95512)


--- trunk/Source/_javascript_Core/wtf/Platform.h	2011-09-20 03:55:29 UTC (rev 95511)
+++ trunk/Source/_javascript_Core/wtf/Platform.h	2011-09-20 04:05:28 UTC (rev 95512)
@@ -1035,10 +1035,6 @@
 #endif
 #endif
 
-#if !defined(ENABLE_LAZY_BLOCK_FREEING)
-#define ENABLE_LAZY_BLOCK_FREEING 1
-#endif
-
 #ifndef ENABLE_LARGE_HEAP
 #if CPU(X86) || CPU(X86_64)
 #define ENABLE_LARGE_HEAP 1
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to