Title: [165486] trunk/Source/_javascript_Core
Revision
165486
Author
[email protected]
Date
2014-03-12 11:17:43 -0700 (Wed, 12 Mar 2014)

Log Message

Layout Test fast/workers/worker-gc.html is failing
https://bugs.webkit.org/show_bug.cgi?id=130135

Reviewed by Geoffrey Garen.

When removing MarkedBlocks, we always expect them to be in the MarkedAllocator's 
main list of blocks, i.e. not in the retired list. When shutting down the VM this
wasn't always the case which was causing ASSERTs to fire. We should rearrange things 
so that allocators are notified with lastChanceToFinalize. This will give them 
the chance to move their retired blocks back into the main list before removing them all.

* heap/MarkedAllocator.cpp:
(JSC::LastChanceToFinalize::operator()):
(JSC::MarkedAllocator::lastChanceToFinalize):
* heap/MarkedAllocator.h:
* heap/MarkedSpace.cpp:
(JSC::LastChanceToFinalize::operator()):
(JSC::MarkedSpace::lastChanceToFinalize):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (165485 => 165486)


--- trunk/Source/_javascript_Core/ChangeLog	2014-03-12 18:16:49 UTC (rev 165485)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-03-12 18:17:43 UTC (rev 165486)
@@ -1,3 +1,24 @@
+2014-03-12  Mark Hahnenberg  <[email protected]>
+
+        Layout Test fast/workers/worker-gc.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=130135
+
+        Reviewed by Geoffrey Garen.
+
+        When removing MarkedBlocks, we always expect them to be in the MarkedAllocator's 
+        main list of blocks, i.e. not in the retired list. When shutting down the VM this
+        wasn't always the case which was causing ASSERTs to fire. We should rearrange things 
+        so that allocators are notified with lastChanceToFinalize. This will give them 
+        the chance to move their retired blocks back into the main list before removing them all.
+
+        * heap/MarkedAllocator.cpp:
+        (JSC::LastChanceToFinalize::operator()):
+        (JSC::MarkedAllocator::lastChanceToFinalize):
+        * heap/MarkedAllocator.h:
+        * heap/MarkedSpace.cpp:
+        (JSC::LastChanceToFinalize::operator()):
+        (JSC::MarkedSpace::lastChanceToFinalize):
+
 2014-03-12  Gavin Barraclough  <[email protected]>
 
         Reduce memory use for static property maps

Modified: trunk/Source/_javascript_Core/heap/MarkedAllocator.cpp (165485 => 165486)


--- trunk/Source/_javascript_Core/heap/MarkedAllocator.cpp	2014-03-12 18:16:49 UTC (rev 165485)
+++ trunk/Source/_javascript_Core/heap/MarkedAllocator.cpp	2014-03-12 18:17:43 UTC (rev 165486)
@@ -226,4 +226,15 @@
     m_nextBlockToSweep = m_blockList.head();
 }
 
+struct LastChanceToFinalize : MarkedBlock::VoidFunctor {
+    void operator()(MarkedBlock* block) { block->lastChanceToFinalize(); }
+};
+
+void MarkedAllocator::lastChanceToFinalize()
+{
+    m_blockList.append(m_retiredBlocks);
+    LastChanceToFinalize functor;
+    forEachBlock(functor);
+}
+
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/heap/MarkedAllocator.h (165485 => 165486)


--- trunk/Source/_javascript_Core/heap/MarkedAllocator.h	2014-03-12 18:16:49 UTC (rev 165485)
+++ trunk/Source/_javascript_Core/heap/MarkedAllocator.h	2014-03-12 18:17:43 UTC (rev 165486)
@@ -21,6 +21,7 @@
     static ptrdiff_t offsetOfFreeListHead();
 
     MarkedAllocator();
+    void lastChanceToFinalize();
     void reset();
     void stopAllocating();
     void resumeAllocating();

Modified: trunk/Source/_javascript_Core/heap/MarkedSpace.cpp (165485 => 165486)


--- trunk/Source/_javascript_Core/heap/MarkedSpace.cpp	2014-03-12 18:16:49 UTC (rev 165485)
+++ trunk/Source/_javascript_Core/heap/MarkedSpace.cpp	2014-03-12 18:17:43 UTC (rev 165486)
@@ -108,15 +108,15 @@
     ASSERT(!m_blocks.set().size());
 }
 
-struct LastChanceToFinalize : MarkedBlock::VoidFunctor {
-    void operator()(MarkedBlock* block) { block->lastChanceToFinalize(); }
+struct LastChanceToFinalize {
+    void operator()(MarkedAllocator& allocator) { allocator.lastChanceToFinalize(); }
 };
 
 void MarkedSpace::lastChanceToFinalize()
 {
     DelayedReleaseScope delayedReleaseScope(*this);
     stopAllocating();
-    forEachBlock<LastChanceToFinalize>();
+    forEachAllocator<LastChanceToFinalize>();
 }
 
 void MarkedSpace::sweep()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to