Closed Bug 661974 Opened 13 years ago Closed 10 years ago

Make option hook that disables YARR-JIT so regexp test suite can be tested on fallback

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: cdleary, Unassigned)

References

Details

Attachments

(1 file)

The problem with having two regexp implementations, one of which compiles a subset of the other, is that the overlap may not yield consistent results. For tests like those in bug 576828 we really want to be able to run the comparison twice if there is a disable-the-JIT capability available to the shell, once with the JIT enabled and once with the JIT disabled.

This bug should also make a little effort to convert some of the existing tests over to a harness that could compare regexp results with the JIT both on and off, but I really would like to have it for tests going forward.
Depends on: 625600
No longer depends on: 625600
No test changes, I may punt that to another bug.

This creates an options interface that doesn't suck. I've dealt with it on several occasions and I still can't remember what options() tells me. I think it's something like "whether these things I put in as varargs strings have been toggled since initialization", which tells you almost nothing.

optionsNG returns you an object that describes the state of all the available options. It optionally takes a single object argument with some subset of those options corresponding to property values whose truthiness is evaluated... this is what I would expect. Example:

js> optionsNG()
({anonfunfix:true, atline:false, jitprofiling:false, tracejit:false, methodjit:false, methodjit_always:false, regexpjit:true, relimit:false, strict:false, werror:false, xml:false})
js> optionsNG({regexpjit: false})
({anonfunfix:true, atline:false, jitprofiling:false, tracejit:false, methodjit:false, methodjit_always:false, regexpjit:false, relimit:false, strict:false, werror:false, xml:false})

In addition, this makes JS_REGEXPJIT into an AC_DEFINE thing, puts a --disable-regexpjit and javascript.options.regexpjit.{chrome,content} into the flow.

Think it's close to ready for review, just have to grep through the millions of pref changing things that we have in the tree to see if they need to know about the new prefs.
(In reply to comment #1)

Oh yeah, and the reason I don't want to rip out options (and instead have added a new interface, optionsNG) is because the test infrastructure is intertwingled with the way that the options() functionality currently works, which is a bit of an overhaul. Now that I think about it, I probably need to make an optionsNG() interface like the current one in js/tests/browser.js for compatibility with browser reftests.
Right now in the code base:

You enable YARR (instead of PCRE) by turning on |ENABLE_YARR_JIT|
You turn on the YARR JIT by having |ENABLE_YARR_JIT && defined(METHODJIT)|

This is clearly broken and should only require some quick lovin' to fix. Luckily, that's the kind of lovin' I'm good at.
Blocks: 673274
Summary: TM: make option hook that disables YARR-JIT so regexp test suite can be tested on fallback → Make option hook that disables YARR-JIT so regexp test suite can be tested on fallback
For bug 691898 we'll want a preprocessor seam, as well as the runtime option we want for fuzz testing.
Blocks: 691898
No longer blocks: 673274
Mass-reassigning cdleary's bugs to default. He won't work on any of them, anymore. I guess, at least.

@cdleary: shout if you take issue with this.
Assignee: cdleary → general
Status: ASSIGNED → NEW
bhackett: is this "disable regexp JIT" option still relevant now that YARR has been with irregexp?
Flags: needinfo?(bhackett1024)
No, this bug is just about yarr, which has been removed entirely.  Irregexp has both an interpreter and a JIT and there is an option for using the former instead of the latter (--no-native-regexp in the shell).
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: needinfo?(bhackett1024)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: