Add js.disable_jit pref (#34231)

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
Samson 2024-11-13 07:50:30 +01:00 committed by GitHub
parent 5e7664b72e
commit 873e82a532
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 0 deletions

View file

@ -3,6 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use js::jsapi::JSObject;
use servo_config::pref;
use crate::dom::bindings::codegen::RegisterBindings;
use crate::dom::bindings::conversions::is_dom_proxy;
@ -61,6 +62,9 @@ unsafe extern "C" fn is_dom_object(obj: *mut JSObject) -> bool {
#[allow(unsafe_code)]
pub fn init() -> JSEngineSetup {
unsafe {
if pref!(js.disable_jit) {
js::jsapi::DisableJitBackend();
}
proxyhandler::init();
// Create the global vtables used by the (generated) DOM