Bug 248682

Summary: Clean up some options initialization workflow.
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Mark Lam 2022-12-02 13:27:47 PST
We always call correctOptions() before recomputeDependentOptions(), and often call dumpOptionsIfNeeded() and ensureOptionsAreCoherent() after.

This patch makes things more consistent by:
1. Rename recomputeDependentOptions() to notifyOptionsChanged().
2. Rename ensureOptionsAreCoherent() to assertOptionsAreCoherent(), because "ensure" implies that the function will make them coherent.  Instead, the function asserts that they are coherent.
3. Move the body of correctOptions() (which is a tiny function) into the top of notifyOptionsChanged().
4. Call dumpOptionsIfNeeded() and assertOptionsAreCoherent() at the end of notifyOptionsChanged() instead of from clients.
5. Make sure clients call notifyOptionsChanged() after changing options.

Additionally:
6. Rename ExecutableAllocator:: setJITEnabled() to ExecutableAllocator::disableJIT().  Disabling JIT in this function was always a one way street, and there's no going back.  This rename makes it clear and explicit.
Comment 1 Radar WebKit Bug Importer 2022-12-02 13:28:13 PST
<rdar://problem/102916238>
Comment 2 Mark Lam 2022-12-02 13:41:21 PST
<rdar://problem/102916238>
Comment 3 Mark Lam 2022-12-02 13:43:08 PST
<rdar://problem/102844335>
Comment 4 Mark Lam 2022-12-02 14:33:47 PST
Pull request: https://github.com/WebKit/WebKit/pull/7095
Comment 5 EWS 2022-12-02 16:29:33 PST
Committed 257311@main (6d72ef261e4a): <https://commits.webkit.org/257311@main>

Reviewed commits have been landed. Closing PR #7095 and removing active labels.