Skip to content

Commit

Permalink
android: Enable JIT compilation on 64-bit Android. (#32284)
Browse files Browse the repository at this point in the history
Based on the investigation in [#31134][1], the [bug][2] in
SpiderMonkey JIT affects only 32-bit systems. Therefore, we
can safely enable JIT compilation again on 64-bit systems.

[1]: #31134
[2]: https://bugzilla.mozilla.org/show_bug.cgi?id=1892374

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
  • Loading branch information
mukilan committed May 14, 2024
1 parent 6c3cf81 commit bb5906e
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions ports/jniapi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -867,11 +867,16 @@ 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_interpreter.enabled".to_string(), false.into());
prefs.insert("js.baseline_jit.enabled".to_string(), false.into());
prefs.insert("js.ion.enabled".to_string(), false.into());
// FIXME: enable JIT compilation on 32-bit Android after the startup crash issue (#31134) is fixed.
let prefs = if cfg!(target_pointer_width = "32") {
let mut prefs = HashMap::new();
prefs.insert("js.baseline_interpreter.enabled".to_string(), false.into());
prefs.insert("js.baseline_jit.enabled".to_string(), false.into());
prefs.insert("js.ion.enabled".to_string(), false.into());
Some(prefs)
} else {
None
};

let opts = InitOptions {
args: args.unwrap_or(vec![]),
Expand All @@ -880,7 +885,8 @@ fn get_options(
density,
xr_discovery: None,
surfman_integration: simpleservo::SurfmanIntegration::Widget(native_window),
prefs: Some(prefs),
prefs,
};

Ok((opts, log, log_str, gst_debug_str))
}

0 comments on commit bb5906e

Please sign in to comment.