Summary: | Add more doesGC() assertions. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Mark Lam <mark.lam> | ||||||
Component: | JavaScriptCore | Assignee: | Mark Lam <mark.lam> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | fpizlo, keith_miller, msaboff, rmorisset, saam, tzagallo, webkit-bug-importer, ysuzuki | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Mark Lam
2019-02-21 12:15:01 PST
Created attachment 362645 [details]
proposed patch.
Comment on attachment 362645 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=362645&action=review > Source/JavaScriptCore/ChangeLog:47 > + (JSC::Heap::collectAsync): I wonder if it's correct for this one. > Source/JavaScriptCore/heap/DeferGC.h:49 > + if (m_heap.deferralDepth() == 1) Why would we not always assert this? We generally don't know if we're the outmost or not. > Source/JavaScriptCore/heap/Heap.cpp:1033 > + RELEASE_ASSERT(expectDoesGC()); I wonder if this should be based on synchronousness Comment on attachment 362645 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=362645&action=review >> Source/JavaScriptCore/ChangeLog:47 >> + (JSC::Heap::collectAsync): > > I wonder if it's correct for this one. collectAsync can GC synchronously as well because: - collectAsync() calls requestCollection() - requestCollection() calls stopIfNecessary() - stopIfNecessary() can calls collectInMutatorThread(). >> Source/JavaScriptCore/heap/DeferGC.h:49 >> + if (m_heap.deferralDepth() == 1) > > Why would we not always assert this? We generally don't know if we're the outmost or not. You're right. This check is not needed. I'll make the assertion unconditional. >> Source/JavaScriptCore/heap/Heap.cpp:1033 >> + RELEASE_ASSERT(expectDoesGC()); > > I wonder if this should be based on synchronousness Async can GC in mutator thread as well (as explained above). Created attachment 362679 [details]
proposed patch after applying Saam's and Yusuke's feedback.
Comment on attachment 362679 [details]
proposed patch after applying Saam's and Yusuke's feedback.
r=me
Thanks for the reviews. Landed in r241927: <http://trac.webkit.org/r241927>. |