Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default feature for JIT #523

Closed
wants to merge 1 commit into from
Closed

Conversation

jschwe
Copy link
Member

@jschwe jschwe commented Nov 11, 2024

This allows optionally disabling JIT by removing the feature. This is necessary on some variants of OpenHarmony, when JIT is forbidden by a system policy.

My idea is that on the servo side, I would disable default-features for mozjs when target_env = "ohos", since the dependency on mozjs is in the script crate. One could then add a direct dependency in servoshell on mozjs (again only for OpenHarmony), so that we can expose a top-level feature js-jit to the user running ./mach, since they are the only one that know if their distribution of openharmony allows jit or not.

Edit:
on the servo side I previously tried setting all the following prefs to false, which still caused JIT related crashes:

  "js.asmjs.enabled": false,
  "js.baseline_interpreter.enabled": false,
  "js.baseline_jit.enabled": false,
  "js.baseline_jit.unsafe_eager_compilation.enabled": false,
  "js.ion.enabled": false,
  "js.ion.offthread_compilation.enabled": false,
  "js.ion.unsafe_eager_compilation.enabled": false,

This allows optionally disabling JIT by removing the
feature. This is necessary on some variants of OpenHarmony,
when JIT is forbidden by a system policy.

Signed-off-by: Jonathan Schwender <[email protected]>
@sagudev
Copy link
Member

sagudev commented Nov 11, 2024

I wonder if android has same problem if we forbid JIT by system?

@jschwe jschwe marked this pull request as ready for review November 12, 2024 07:02
@jschwe
Copy link
Member Author

jschwe commented Nov 12, 2024

Is it possible to forbid JIT on android? If so, I'd assume we would hit the same issue.

@sagudev
Copy link
Member

sagudev commented Nov 12, 2024

Is it possible to forbid JIT on android? If so, I'd assume we would hit the same issue.

I imagine it should be possible using SELinux policies.

BTW I think you also need to disable wasm JIT (wasm_baselinejit, wasm_ionjit) although I am not sure we expose those prefs.

@sagudev
Copy link
Member

sagudev commented Nov 12, 2024

@sagudev sagudev mentioned this pull request Nov 12, 2024
3 tasks
@sagudev
Copy link
Member

sagudev commented Nov 13, 2024

I am going to close this given the main usecase was resolved by servo/servo#34231.

@sagudev sagudev closed this Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants