• 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
..
api Loading commit data...
asmjs Loading commit data...
ast Loading commit data...
base Loading commit data...
builtins Loading commit data...
codegen Loading commit data...
common Loading commit data...
compiler Loading commit data...
compiler-dispatcher Loading commit data...
d8 Loading commit data...
date Loading commit data...
debug Loading commit data...
deoptimizer Loading commit data...
diagnostics Loading commit data...
execution Loading commit data...
extensions Loading commit data...
flags Loading commit data...
handles Loading commit data...
heap Loading commit data...
ic Loading commit data...
init Loading commit data...
inspector Loading commit data...
interpreter Loading commit data...
json Loading commit data...
libplatform Loading commit data...
libsampler Loading commit data...
logging Loading commit data...
numbers Loading commit data...
objects Loading commit data...
parsing Loading commit data...
profiler Loading commit data...
protobuf Loading commit data...
regexp Loading commit data...
roots Loading commit data...
runtime Loading commit data...
sanitizer Loading commit data...
snapshot Loading commit data...
strings Loading commit data...
tasks Loading commit data...
third_party Loading commit data...
torque Loading commit data...
tracing Loading commit data...
trap-handler Loading commit data...
utils Loading commit data...
wasm Loading commit data...
zone Loading commit data...
DEPS Loading commit data...
OWNERS Loading commit data...