Skip to content

Commit

Permalink
android: disable jit to workaround servo#31134
Browse files Browse the repository at this point in the history
Signed-off-by: Mukilan Thiyagarajan <[email protected]>
  • Loading branch information
mukilan committed Feb 6, 2024
1 parent 54fb381 commit 6acc574
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions components/script/script_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,11 @@ unsafe fn new_rt_and_cx_with_parent(

// Enable or disable the JITs.
let cx_opts = &mut *ContextOptionsRef(cx);
JS_SetGlobalJitCompilerOption(
cx,
JSJitCompilerOption::JSJITCOMPILER_BASELINE_INTERPRETER_ENABLE,
pref!(js.baseline.enabled) as u32,
);
JS_SetGlobalJitCompilerOption(
cx,
JSJitCompilerOption::JSJITCOMPILER_BASELINE_ENABLE,
Expand Down
10 changes: 9 additions & 1 deletion ports/libsimpleservo/jniapi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#![allow(non_snake_case)]

use std::collections::HashMap;
use std::os::raw::{c_char, c_int, c_void};
use std::sync::Arc;
use std::thread;
Expand Down Expand Up @@ -844,6 +845,13 @@ fn get_options(
};

let native_window = unsafe { ANativeWindow_fromSurface(env.get_native_interface(), surface) };

// FIXME: enable JIT compilation on Android after the
// startup crash issue (#31134) is fixed.
let mut prefs = HashMap::new();
prefs.insert("js.baseline.enabled".to_string(), false.into());
prefs.insert("js.ion.enabled".to_string(), false.into());

let opts = InitOptions {
args: args.unwrap_or(vec![]),
coordinates,
Expand All @@ -852,7 +860,7 @@ fn get_options(
gl_context_pointer: None,
native_display_pointer: None,
surfman_integration: simpleservo::SurfmanIntegration::Widget(native_window),
prefs: None,
prefs: Some(prefs),
};
Ok((opts, log, log_str, gst_debug_str))
}

0 comments on commit 6acc574

Please sign in to comment.