WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
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-
Details
Formatted Diff
Diff
proposed patch.
(6.84 KB, patch)
2016-08-10 16:52 PDT
,
Mark Lam
ggaren
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
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
Landed in
r204387
: <
http://trac.webkit.org/r204387
>.
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.
Top of Page
Format For Printing
XML
Clone This Bug