• Jakob Gruber's avatar
    [regexp] Add a backtracking limit in the interpreter · 48756fcf
    Jakob Gruber authored
    V8 uses a backtracking regexp engine, which has the caveat that some
    regexp patterns can have exponential runtime behavior when excessive
    backtracking is involved.
    
    Especially when regexp patterns are user-controlled, it would be useful
    to be able to set an upper limit for a single regexp execution. This CL
    takes an initial step in that direction by adding a backtracking limit
    (intended to approximate execution time):
    
    - The limit is stored in the JSRegExp's data array.
    - A limit can currently only be set through the %NewRegExpWithLimit
    runtime function.
    - The limit is applied during interpreter execution. When exceeded, the
    interpreter stops execution and returns FAILURE (even if continued
    execution would at some later point have resulted in SUCCESS).
    
    In follow-up CLs, this mechanism will be extended to work in jitted
    regexp code, and exposed through the V8 API.
    
    Bug: v8:9695
    Change-Id: Iadb5c100052f4a63b26f1ec49cf97c6713a66b9b
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1864934
    Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
    Auto-Submit: Jakob Gruber <jgruber@chromium.org>
    Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
    Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#64417}
    48756fcf
Name
Last commit
Last update
..
benchmarks Loading commit data...
cctest Loading commit data...
common Loading commit data...
debugger Loading commit data...
fuzzer Loading commit data...
inspector Loading commit data...
intl Loading commit data...
js-perf-test Loading commit data...
memory Loading commit data...
message Loading commit data...
mjsunit Loading commit data...
mkgrokdump Loading commit data...
mozilla Loading commit data...
preparser Loading commit data...
test262 Loading commit data...
torque Loading commit data...
unittests Loading commit data...
wasm-api-tests Loading commit data...
wasm-js Loading commit data...
wasm-spec-tests Loading commit data...
webkit Loading commit data...
BUILD.gn Loading commit data...
OWNERS Loading commit data...