Title: [204542] trunk/Source/_javascript_Core
Revision
204542
Author
[email protected]
Date
2016-08-16 17:18:43 -0700 (Tue, 16 Aug 2016)

Log Message

Heap::collectAllGarbage() should work with JSC_useImmortalObjects=true.
https://bugs.webkit.org/show_bug.cgi?id=160917

Reviewed by Filip Pizlo.

If we do an synchronous GC when JSC_useImmortalObjects=true, we'll get a
RELEASE_ASSERT failure:

    $ JSC_useImmortalObjects=true jsc
    >>> gc()
    Trace/BPT trap: 5

This is because Heap::collectAllGarbage() is doing an explicit sweep of the
MarkedSpace, and the sweeper is expecting to see no RetiredBlocks.  However, we
make objects immortal by retiring their blocks.  As a result, there is a mismatch
in expectancy.

The fix is simply to not run the sweeper when JSC_useImmortalObjects=true.

* heap/Heap.cpp:
(JSC::Heap::collectAllGarbage):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (204541 => 204542)


--- trunk/Source/_javascript_Core/ChangeLog	2016-08-16 23:59:19 UTC (rev 204541)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-08-17 00:18:43 UTC (rev 204542)
@@ -1,3 +1,27 @@
+2016-08-16  Mark Lam  <[email protected]>
+
+        Heap::collectAllGarbage() should work with JSC_useImmortalObjects=true.
+        https://bugs.webkit.org/show_bug.cgi?id=160917
+
+        Reviewed by Filip Pizlo.
+
+        If we do an synchronous GC when JSC_useImmortalObjects=true, we'll get a
+        RELEASE_ASSERT failure:
+
+            $ JSC_useImmortalObjects=true jsc
+            >>> gc()
+            Trace/BPT trap: 5
+
+        This is because Heap::collectAllGarbage() is doing an explicit sweep of the
+        MarkedSpace, and the sweeper is expecting to see no RetiredBlocks.  However, we
+        make objects immortal by retiring their blocks.  As a result, there is a mismatch
+        in expectancy.
+
+        The fix is simply to not run the sweeper when JSC_useImmortalObjects=true.
+
+        * heap/Heap.cpp:
+        (JSC::Heap::collectAllGarbage):
+
 2016-08-16  Keith Miller  <[email protected]>
 
         Add WASM I32 simple operators.

Modified: trunk/Source/_javascript_Core/heap/Heap.cpp (204541 => 204542)


--- trunk/Source/_javascript_Core/heap/Heap.cpp	2016-08-16 23:59:19 UTC (rev 204541)
+++ trunk/Source/_javascript_Core/heap/Heap.cpp	2016-08-17 00:18:43 UTC (rev 204542)
@@ -1079,9 +1079,13 @@
     collect(FullCollection);
 
     DeferGCForAWhile deferGC(*this);
-    m_objectSpace.sweep();
-    m_objectSpace.shrink();
-    m_blockSnapshot.clear();
+    if (UNLIKELY(Options::useImmortalObjects()))
+        sweeper()->willFinishSweeping();
+    else {
+        m_objectSpace.sweep();
+        m_objectSpace.shrink();
+    }
+    ASSERT(m_blockSnapshot.isEmpty());
 
     sweepAllLogicallyEmptyWeakBlocks();
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to