Bug 232975

Summary: Move m_doesGC from Heap to VM.
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, benjamin, calvaris, ews-watchlist, fpizlo, gyuyoung.kim, hi, joepeck, keith_miller, msaboff, pangle, ryuan.choi, saam, sergio, tzagallo, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 232849    
Attachments:
Description Flags
proposed patch. fpizlo: review+, ews-feeder: commit-queue-

Description Mark Lam 2021-11-10 17:18:06 PST
m_doesGC is only needed for ENABLE(DFG_DOES_GC_VALIDATION), and is used for checking if the VM thread's execution is in a state that can allow GC to run.  Hence, it is more related to VM thread execution as opposed to the state of the Heap.  This patch moves m_doesGC from Heap to VM to get it out of the way of upcoming Global GC work.

Also change DeferGC and DeferGCForAWhile to take a VM& instead of a Heap&.  DeferGC needs to access VM& in order to call VM::verifyCanGC().  DeferGCForAWhile does not need VM&, but we're changing it to be consistent with DeferGC.  There should be no perf impact for this change.
Comment 1 Radar WebKit Bug Importer 2021-11-10 17:18:54 PST
<rdar://problem/85277492>
Comment 2 Mark Lam 2021-11-10 17:46:28 PST
Created attachment 443885 [details]
proposed patch.
Comment 3 Mark Lam 2021-11-11 09:32:21 PST
Thanks for the review.  Landed in r285636: <http://trac.webkit.org/r285636>.