Open Bug 1830934 Opened 1 years ago Updated 1 years ago

Add command line flags to Firefox for JS engine options

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: mstange, Unassigned)

References

(Blocks 1 open bug)

Details

(I'm filing this in the JS engine component rather than in Toolkit :: Startup and Profile System because I figure this component reaches the more interested audience.)

When running the Spidermonkey shell, you can pass arguments which change its behavior, for example:

% js --enable-ic-frame-pointers --only-inline-selfhosted --spectre-mitigations=off --no-async-stacks index.js

But when running Firefox, passing the same flags is harder. You can get an approximation like this:

% JIT_OPTION_enableICFramePointers=true JIT_OPTION_onlyInlineSelfHosted=true \
JIT_OPTIONS_spectreIndexMasking=false JIT_OPTIONS_spectreObjectMitigations=false \
JIT_OPTIONS_spectreStringMitigations=false JIT_OPTIONS_spectreValueMasking=false \
JIT_OPTIONS_spectreJitToCxxCalls=false firefox

but this is quite unwieldy, and environment variables are harder to use than command line flags. Also, for --no-async-stacks, you'd additionally have to set the pref javascript.options.asyncstack to false on about:config.

It would be great if you were able to do this instead:

% firefox --js-shell="--enable-ic-frame-pointers --only-inline-selfhosted --spectre-mitigations=off --no-async-stacks"

Chrome has a --js-shell argument that does this.

Blocks: sm-meta
Severity: -- → N/A
Priority: -- → P3
Blocks: 1808579
No longer blocks: sm-meta

Having to use environment variables is especially painful on Windows where you need to do:

set JIT_OPTION_enableICFramePointers=true && set JIT_OPTION_onlyInlineSelfHosted=true && \
set JIT_OPTIONS_spectreIndexMasking=false && set JIT_OPTIONS_spectreObjectMitigations=false && \
set JIT_OPTIONS_spectreStringMitigations=false &&  set JIT_OPTIONS_spectreValueMasking=false && \
set JIT_OPTIONS_spectreJitToCxxCalls=false

This seems possible, mostly, but would be a good chunk of work with a careful scalpel.

Might be better to spend time on cleaning up our option parsing story before tackling this

You need to log in before you can comment on or make changes to this bug.