1. OptionsStorage was storing options default values. This is unnecessary because default values are only used to provide more info when dumping options. We've move default values to a transient OptionsHelper::Metadata data structure that is heap allocated, and now freed in Options::finalize(). 2. Consolidate calls to dump options. Previously, we do it every time in Options::notifyOptionsChanged() and in the jsc shell. Now, we only do it once in Options::finalize(). We also now only assertOptionsAreCoherent() in Options::finalize() instead of doing it repeatedly. 3. Renamed Options::dumpOptionsIfNeeded() into Options::executeDumpOptions(). This is now the entrypoint to dump options (with the exception of dumpAllOptionsInALine() which is used by tests). 4. Moved contents of the OptionReader class into the OptionsHelper namespace to consolidate all the helper tools. 5. Moved Options::s_constMetaData into the OptionsHelper namespace as g_constMetaData. It is only needed for options initialization. 6. Added a g_optionWasOverridden BitSet to track whether an option has been modified (previously, we were comparing the options against their defaults). We keep these as a global instead of in OptionsHelper::Metadata because it is small (56 bytes), and keeping it around makes options dumping more robust in case anyone wants to call the dumpers interactively in a debugging session. g_optionWasOverridden is not protected in JSC::Config because after initialization, it is only used by the dumpers, and is not critical to security. 7. Convert some static functions used for computing default options values into members of Options. On ARM64, OptionsStorage shrinks from 2632 bytes to 1424 bytes.
<rdar://problem/114565432>
Pull request: https://github.com/WebKit/WebKit/pull/17128
Committed 267371@main (242566c54a3c): <https://commits.webkit.org/267371@main> Reviewed commits have been landed. Closing PR #17128 and removing active labels.