RESOLVED FIXED260797
Reduce size of OptionsStorage in JSC::Config.
https://bugs.webkit.org/show_bug.cgi?id=260797
Summary Reduce size of OptionsStorage in JSC::Config.
Mark Lam
Reported 2023-08-28 08:18:12 PDT
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.
Attachments
Radar WebKit Bug Importer
Comment 1 2023-08-28 08:18:37 PDT
Mark Lam
Comment 2 2023-08-28 08:24:35 PDT
EWS
Comment 3 2023-08-28 16:04:37 PDT
Committed 267371@main (242566c54a3c): <https://commits.webkit.org/267371@main> Reviewed commits have been landed. Closing PR #17128 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.