aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/init.rs
diff options
context:
space:
mode:
authorSamson <16504129+sagudev@users.noreply.github.com>2024-11-13 07:50:30 +0100
committerGitHub <noreply@github.com>2024-11-13 06:50:30 +0000
commit873e82a5329dffeeef9c91d0e47cf34c41c53b03 (patch)
tree5f85e69e6cf7dd97111520988f33a813e83dd1d2 /components/script/init.rs
parent5e7664b72e4f1940f4719dddbedc6d1656c8c47e (diff)
downloadservo-873e82a5329dffeeef9c91d0e47cf34c41c53b03.tar.gz
servo-873e82a5329dffeeef9c91d0e47cf34c41c53b03.zip
Add `js.disable_jit` pref (#34231)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Diffstat (limited to 'components/script/init.rs')
-rw-r--r--components/script/init.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/components/script/init.rs b/components/script/init.rs
index badd36668bb..ec49c3f2953 100644
--- a/components/script/init.rs
+++ b/components/script/init.rs
@@ -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