RESOLVED FIXED 160716
Disallow synchronous sweeping for eden GCs.
https://bugs.webkit.org/show_bug.cgi?id=160716
Summary Disallow synchronous sweeping for eden GCs.
Mark Lam
Reported 2016-08-09 16:19:01 PDT
This functionality was broken, and it was only used by $vm.edenGC(). It's sad that we can't do a synchronous sweep after an edenGC for testing purposes anymore, but as far as I know, this functionality hasn't been used much. So, I'm removing it for now and switching $vm.edenGC() do the default eden GC behavior which lets the incremental sweeper do the sweeping.
Attachments
proposed patch. (9.84 KB, patch)
2016-08-09 18:14 PDT, Mark Lam
fpizlo: review-
proposed patch. (6.84 KB, patch)
2016-08-10 16:52 PDT, Mark Lam
ggaren: review+
Mark Lam
Comment 1 2016-08-09 17:53:40 PDT
Actually, ... I can make collectAndSweep() work with EdenCollections with no perf impact. And so I shall do that and retain the current behavior of $vm.edenGC().
Mark Lam
Comment 2 2016-08-09 18:14:17 PDT
Created attachment 285704 [details] proposed patch.
Filip Pizlo
Comment 3 2016-08-10 14:59:26 PDT
Comment on attachment 285704 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=285704&action=review > Source/JavaScriptCore/heap/Heap.cpp:1095 > + // Sweep the list of blocks that the IncrementalSweeper would have swept later. > + while (!m_blockSnapshot.isEmpty()) { > + MarkedBlock* block = m_blockSnapshot.takeLast(); > + block->sweep(); > + objectSpace().freeOrShrinkBlock(block); > + } This is a layering violation. ObjectSpace should own any logic like this. For that reason, I think we should just disallow collectAndSweep in eden.
Mark Lam
Comment 4 2016-08-10 15:03:43 PDT
Going back to disallowing collectAndSweep for EdenCollections.
Mark Lam
Comment 5 2016-08-10 16:52:02 PDT
Created attachment 285785 [details] proposed patch.
Geoffrey Garen
Comment 6 2016-08-11 11:46:17 PDT
Comment on attachment 285785 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=285785&action=review > Source/JavaScriptCore/heap/MarkedBlock.h:193 > + // will simply ignore Retured blocks (i.e. they will not be swept even Retired
Geoffrey Garen
Comment 7 2016-08-11 13:27:38 PDT
Comment on attachment 285785 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=285785&action=review r=me > Source/JavaScriptCore/heap/MarkedBlock.cpp:-160 > case Allocated: > RELEASE_ASSERT_NOT_REACHED(); > - return FreeList(); Since all cases are handled in this switch, I think you can leave the return here and remove the assert and return at the end of the function.
Mark Lam
Comment 8 2016-08-11 13:32:47 PDT
Comment on attachment 285785 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=285785&action=review Thanks for the review. Will fix the issues before landing. >> Source/JavaScriptCore/heap/MarkedBlock.cpp:-160 >> - return FreeList(); > > Since all cases are handled in this switch, I think you can leave the return here and remove the assert and return at the end of the function. Ok. Will do. >> Source/JavaScriptCore/heap/MarkedBlock.h:193 >> + // will simply ignore Retured blocks (i.e. they will not be swept even > > Retired Will fix.
Mark Lam
Comment 9 2016-08-11 14:20:28 PDT
Mark Lam
Comment 10 2016-08-11 18:05:46 PDT
(In reply to comment #8) > >> Source/JavaScriptCore/heap/MarkedBlock.cpp:-160 > >> - return FreeList(); > > > > Since all cases are handled in this switch, I think you can leave the return here and remove the assert and return at the end of the function. > > Ok. Will do. gcc did not like this. I restored the assertion and return statement at the end of the function. Fix landed in r204398: <http://trac.webkit.org/r204398>.
Note You need to log in before you can comment on or make changes to this bug.