2011-04-04 Geoffrey Garen <ggaren@apple.com>
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Apr 2011 21:04:39 +0000 (21:04 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Apr 2011 21:04:39 +0000 (21:04 +0000)
        Reviewed by Oliver Hunt.

        Removed a redundant variable from HandleHeap
        https://bugs.webkit.org/show_bug.cgi?id=57786

        We don't need a specific variable to indicate that we're in the middle
        of the finalization phase, since m_nextToFinalize already does this.

        * collector/handles/HandleHeap.cpp:
        (JSC::HandleHeap::HandleHeap):
        (JSC::HandleHeap::clearWeakPointers):
        (JSC::HandleHeap::writeBarrier):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@82871 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/collector/handles/HandleHeap.cpp

index ee92fce..6f9ad93 100644 (file)
@@ -2,6 +2,21 @@
 
         Reviewed by Oliver Hunt.
 
+        Removed a redundant variable from HandleHeap
+        https://bugs.webkit.org/show_bug.cgi?id=57786
+        
+        We don't need a specific variable to indicate that we're in the middle
+        of the finalization phase, since m_nextToFinalize already does this.
+
+        * collector/handles/HandleHeap.cpp:
+        (JSC::HandleHeap::HandleHeap):
+        (JSC::HandleHeap::clearWeakPointers):
+        (JSC::HandleHeap::writeBarrier):
+
+2011-04-04  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Oliver Hunt.
+
         Renamed Finalizer => WeakHandleOwner (in preparation for adding a reachability callback)
         https://bugs.webkit.org/show_bug.cgi?id=57775
         
index e359568..09d217c 100644 (file)
@@ -34,9 +34,6 @@ namespace JSC {
 HandleHeap::HandleHeap(JSGlobalData* globalData)
     : m_globalData(globalData)
     , m_nextToFinalize(0)
-#if !ASSERT_DISABLED
-    , m_handlingFinalizers(false)
-#endif
 {
     grow();
 }
@@ -65,10 +62,6 @@ void HandleHeap::updateAfterMark()
 
 void HandleHeap::clearWeakPointers()
 {
-#if !ASSERT_DISABLED
-    m_handlingFinalizers = true;
-#endif
-
     Node* end = m_weakList.end();
     for (Node* node = m_weakList.begin(); node != end; node = m_nextToFinalize) {
         m_nextToFinalize = node->next();
@@ -96,15 +89,14 @@ void HandleHeap::clearWeakPointers()
         SentinelLinkedList<Node>::remove(node);
         m_immediateList.push(node);
     }
-
-#if !ASSERT_DISABLED
-    m_handlingFinalizers = false;
-#endif
+    
+    m_nextToFinalize = 0;
 }
 
 void HandleHeap::writeBarrier(HandleSlot slot, const JSValue& value)
 {
-    ASSERT(!m_handlingFinalizers);
+    ASSERT(!m_nextToFinalize); // Forbid assignment to handles during the finalization phase, since it would violate many GC invariants.
+
     if (slot->isCell() == value.isCell() && !value == !*slot)
         return;
     Node* node = toNode(slot);