Title: [191015] trunk/Source/_javascript_Core
Revision
191015
Author
[email protected]
Date
2015-10-13 17:10:07 -0700 (Tue, 13 Oct 2015)

Log Message

Simplify WeakBlock visit and reap phases
https://bugs.webkit.org/show_bug.cgi?id=150045

Patch by Joseph Pecoraro <[email protected]> on 2015-10-13
Reviewed by Geoffrey Garen.

WeakBlock visiting and reaping both happen after MarkedBlock marking.
All the MarkedBlocks we encounter should be either Marked or Retired.

* heap/MarkedBlock.h:
(JSC::MarkedBlock::isMarkedOrRetired):
* heap/WeakBlock.cpp:
(JSC::WeakBlock::visit):
(JSC::WeakBlock::reap):
* heap/WeakBlock.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (191014 => 191015)


--- trunk/Source/_javascript_Core/ChangeLog	2015-10-13 23:40:38 UTC (rev 191014)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-10-14 00:10:07 UTC (rev 191015)
@@ -1,3 +1,20 @@
+2015-10-13  Joseph Pecoraro  <[email protected]>
+
+        Simplify WeakBlock visit and reap phases
+        https://bugs.webkit.org/show_bug.cgi?id=150045
+
+        Reviewed by Geoffrey Garen.
+
+        WeakBlock visiting and reaping both happen after MarkedBlock marking.
+        All the MarkedBlocks we encounter should be either Marked or Retired.
+
+        * heap/MarkedBlock.h:
+        (JSC::MarkedBlock::isMarkedOrRetired):
+        * heap/WeakBlock.cpp:
+        (JSC::WeakBlock::visit):
+        (JSC::WeakBlock::reap):
+        * heap/WeakBlock.h:
+
 2015-10-12  Geoffrey Garen  <[email protected]>
 
         CodeBlock write barriers should be precise

Modified: trunk/Source/_javascript_Core/heap/MarkedBlock.h (191014 => 191015)


--- trunk/Source/_javascript_Core/heap/MarkedBlock.h	2015-10-13 23:40:38 UTC (rev 191014)
+++ trunk/Source/_javascript_Core/heap/MarkedBlock.h	2015-10-14 00:10:07 UTC (rev 191015)
@@ -164,6 +164,7 @@
         void clearNewlyAllocated(const void*);
 
         bool isAllocated() const;
+        bool isMarkedOrRetired() const;
         bool needsSweeping() const;
         void didRetireBlock(const FreeList&);
         void willRemoveBlock();
@@ -448,6 +449,11 @@
         return m_state == Allocated;
     }
 
+    inline bool MarkedBlock::isMarkedOrRetired() const
+    {
+        return m_state == Marked || m_state == Retired;
+    }
+
 } // namespace JSC
 
 namespace WTF {

Modified: trunk/Source/_javascript_Core/heap/WeakBlock.cpp (191014 => 191015)


--- trunk/Source/_javascript_Core/heap/WeakBlock.cpp	2015-10-13 23:40:38 UTC (rev 191014)
+++ trunk/Source/_javascript_Core/heap/WeakBlock.cpp	2015-10-14 00:10:07 UTC (rev 191015)
@@ -102,8 +102,8 @@
     // If this WeakBlock doesn't belong to a MarkedBlock, we won't even be here.
     ASSERT(m_markedBlock);
 
-    if (m_markedBlock->isAllocated())
-        return;
+    // We only visit after marking.
+    ASSERT(m_markedBlock->isMarkedOrRetired());
 
     SlotVisitor& visitor = heapRootVisitor.visitor();
 
@@ -136,8 +136,8 @@
     // If this WeakBlock doesn't belong to a MarkedBlock, we won't even be here.
     ASSERT(m_markedBlock);
 
-    if (m_markedBlock->isAllocated())
-        return;
+    // We only reap after marking.
+    ASSERT(m_markedBlock->isMarkedOrRetired());
 
     for (size_t i = 0; i < weakImplCount(); ++i) {
         WeakImpl* weakImpl = &weakImpls()[i];

Modified: trunk/Source/_javascript_Core/heap/WeakBlock.h (191014 => 191015)


--- trunk/Source/_javascript_Core/heap/WeakBlock.h	2015-10-13 23:40:38 UTC (rev 191014)
+++ trunk/Source/_javascript_Core/heap/WeakBlock.h	2015-10-14 00:10:07 UTC (rev 191015)
@@ -73,7 +73,6 @@
     static FreeCell* asFreeCell(WeakImpl*);
 
     explicit WeakBlock(MarkedBlock&);
-    WeakImpl* firstWeakImpl();
     void finalize(WeakImpl*);
     WeakImpl* weakImpls();
     size_t weakImplCount();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to