Closed Bug 1165905 Opened 9 years ago Closed 8 years ago

JS_GetGlobalJitCompilerOption should handle all options

Categories

(Core :: JavaScript Engine: JIT, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: jandem, Assigned: jonco)

Details

Attachments

(1 file)

Just noticed this:

js> getJitCompilerOptions()["ion.gvn.enable"]
0

The problem is that JS_GetGlobalJitCompilerOption returns 0 for unknown options. It should probably MOZ_CRASH.

Some jit-tests do:

    var oldOpts = getJitCompilerOptions();
    ...
    for (var k in oldOpts)
        setJitCompilerOption(k, oldOpts[k]);

Because of this bug, this will currently disable some options like GVN.
I guess a simple self-test would be to verify that getJitCompilerOptions returns an object which has identical properties and values.

    load(libdir + "asserts.js");
    var oldOpts = getJitCompilerOptions();
    for (var k in oldOpts)
        setJitCompilerOption(k, oldOpts[k]);
    var newOpts = getJitCompilerOptions();
    assertDeepEq(oldOpts, newOpts);
Patch to make this fallible and fail for unknown options.  Testcase as suggested.  The API itself doesn't seem to be used outside the engine.
Assignee: nobody → jcoppeard
Attachment #8798054 - Flags: review?(jdemooij)
Comment on attachment 8798054 [details] [diff] [review]
bug1165905-compiler-options

Review of attachment 8798054 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks!
Attachment #8798054 - Flags: review?(jdemooij) → review+
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/4c2db6614dbe
Make JS_GetGlobalJitCompilerOption fail for unknown options r=jandem
https://hg.mozilla.org/mozilla-central/rev/4c2db6614dbe
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: