Closed Bug 1631504 Opened 4 years ago Closed 4 years ago

Irregexp: Add JitOptions

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: iain, Assigned: iain)

References

Details

Attachments

(6 files)

For testing purposes, we want to be able to control when/whether we tier up from interpreted to compiled regexps.

Also, irregexp relies on a bunch of global FLAG_* variables for the equivalent of JitOptions. Many of them should just be hardcoded to a specific value, but some of them (particularly the tracing options) are worth hooking up.

To ensure that we get adequate test coverage of compiled regexps without having to add a new testing configuration, I've set it up so that --baseline-eager and --ion-eager imply --regexp-warmup-threshold=0.

The threshold of 10 continues to be arbitrary. We can do performance tuning later.

If unaligned loads are allowed, then we can load multiple characters at once and speed up some comparisons.

The implementation of CanReadUnaligned is taken from the old import (NativeRegExpMacroAssembler::CanReadUnaligned).

Depends on D71634

V8 has a correctness_fuzzer_suppressions flag that it uses for differential fuzzing. Our equivalent is JS_MORE_DETERMINISTIC.

The code being added to HasOverflowed is taken from RegExpCompiler::CheckOverRecursed in the old import. See bug 1455954.

Depends on D71635

V8's equivalent to JitOptions is a macro for defining global variables. The shim defines the subset of those variables that are used inside irregexp. We don't have any good reason to modify most of them, so this patch turns them into constants and documents the reasons we aren't exposing them.

The tracing flags will be hooked up in the next patch.

Depends on D71636

V8 comes with a number of tracing options built-in. We might as well make them available for debugging in the shell.

--regexp-trace-assembler doesn't do anything yet. Support will be added in the next patch.

Depends on D71637

Regexp assembler tracing is done using a wrapper that logs the macroassembler API calls.

Depends on D71638

Pushed by iireland@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f2e2d758a0ed
Add a jit option to control the regexp warmup threshold r=mgaudet
https://hg.mozilla.org/integration/autoland/rev/0a1e9d5bef6d
Implement CanReadUnaligned r=mgaudet
https://hg.mozilla.org/integration/autoland/rev/1e3e2417a0a2
Improve over-recursion in more-deterministic builds r=mgaudet
https://hg.mozilla.org/integration/autoland/rev/1db8625a629c
Hard-code and document some flag values r=mgaudet
https://hg.mozilla.org/integration/autoland/rev/9d77534b5152
Add tracing options r=mgaudet
https://hg.mozilla.org/integration/autoland/rev/342710b2598d
Implement trace-regexp-assembler r=mgaudet
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: