Currently there is no link between web features (declared in UnifiedWebPreferences.yaml, accessible to WebCore and WebKit) and JavaScriptCore options. These aren't 1:1, but there are some examples of situations where it would be valuable to use feature toggles to A/B test a JSC feature, or use the default values associated with feature status to control JSC's defaults (e.g. turning something on in testing and Safari Technology Preview, but not in stable browsers). I propose we add an optional "JavaScriptCoreBinding" field to the preference generator, which maps a feature to a JSC option name. At web content process creation time, the UI process can pass these options as environment variables to JSC. We can't set JSC options after the VM is initialized, so there's no way to wire up the WebCore::Settings machinery to change settings in a running page. But browsers can prompt users to restart or open a new tab. If we wanted to be more heavy-handed, we could do a WebProcessPool::terminateAllWebContentProcesses() to recreate all VMs in response to such a change.
<rdar://problem/104207681>