Allow enabling Ion on Chrome content (including Extensions) but disabling it on web content
Categories
(Core :: JavaScript Engine: JIT, enhancement, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox75 | --- | fixed |
People
(Reporter: tjr, Assigned: tjr)
References
Details
(Whiteboard: [tor 23719])
Attachments
(4 files, 1 obsolete file)
After Bug 1576254 landed; Tor tested the performance of HTTPS Everywhere and found that with Ion disabled but WASM enabled, the extension was still un-usuably slow. So the thought is to apply the same type of exception for the general JIT Compiler so that it will work for privileged code (chrome and extension code.)
javascript.options.ion is currently a process-wide boolean; but looking through where it is checked, I think we have a JSContext in all of those places; so it seems like it would be possible to move the boolean to ContextOptions like wasmForTrustedPrinciples_...
I can start prototyping this if people think that is a good approach.
Assignee | ||
Updated•5 years ago
|
Comment 1•5 years ago
|
||
Using a symmetric approach sounds like a generally good idea.
Comment 2•5 years ago
|
||
(In reply to Tom Ritter [:tjr] (needinfo for responses to sec-[approval/ratings/advisories/cve's]) from comment #0)
javascript.options.ion is currently a process-wide boolean; but looking through where it is checked, I think we have a JSContext in all of those places; so it seems like it would be possible to move the boolean to ContextOptions like wasmForTrustedPrinciples_...
I really want to keep the JIT options process-wide because it's simpler: we don't have to worry about setting it correctly for every worker/worklet/PAC JSContext. I'm pretty sure the Wasm prefs are 'broken' in some of these cases.
Adding a process-wide ionForTrustedPrincipals bool to JitOptions should work probably? We then also have to pass a JSContext* cx
to IsIonEnabled
for the runningWithTrustedPrincipals() bit but that should be OK, AFAIK.
Updated•5 years ago
|
Assignee | ||
Comment 3•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Comment 4•5 years ago
|
||
Here's a patch that looks like it should work. Seems to build/test fine: https://treeherder.mozilla.org/#/jobs?repo=try&revision=2a077c5d2065ccba316d365c5a7a6d5edcd70fcb
However I am not quite sure how to test it. For WASM I could do (WebAssembly in this) but I don't imagine there is a similarly easy way to test this?
Updated•5 years ago
|
Assignee | ||
Comment 5•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Comment 6•5 years ago
|
||
We need to move IsBaseLineJitEnabled into BaselineJit.h.
Then we need to include BaselineJit.h from Ion.h.
HOWEVER, lots of things include Ion.h and we create an include
loop with BaselineJit.h. Fortunately; however, the reason lots
of things include Ion.h is to get at the JitContext that's
defined in Ion.h - and it doesn't need to be.
So we move JitContext and a few other things into a separate
header and include that instead of Ion.h
Depends on D61076
Assignee | ||
Comment 7•5 years ago
|
||
Because Tor disables both the Ion Jit and the Baseline Jit, we want
to enable both of them for trusted principals; not just Ion.
Depends on D61271
Assignee | ||
Comment 8•5 years ago
|
||
This is good to go, but going to wait until after the freeze
Comment 10•5 years ago
|
||
Backed out 3 changesets (Bug 1599226) for causing hazards busatges CLOSED TREE
Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&selectedJob=288245610&resultStatus=testfailed%2Cbusted%2Cexception&revision=05b2d3c59b8889d49c14951d4db324f0e681d656
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=288245610&repo=autoland&lineNumber=76418
Backout: https://hg.mozilla.org/integration/autoland/rev/ecc878c4b4e0541c5bd3c676ea653744c60b4359
Assignee | ||
Comment 11•5 years ago
|
||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 12•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Comment 13•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/48254d93985b
https://hg.mozilla.org/mozilla-central/rev/a0af6d24f388
https://hg.mozilla.org/mozilla-central/rev/b22c4902d295
https://hg.mozilla.org/mozilla-central/rev/89238a8216db
Description
•