Commit 3b9f8155 authored by Ana Pesko's avatar Ana Pesko Committed by Commit Bot

Revert "[regexp] Eagerly tier-up for very long strings"

This reverts commit cfb60d43.

Reason for revert: Several bots timing out, e.g.
https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20gc%20stress/24717

Original change's description:
> [regexp] Eagerly tier-up for very long strings
>
> For very long subject strings, the regexp interpreter is currently much slower
> than the native machine code execution. This CL implements eager tier-up to the
> compiler to avoid the performance penalty for subject strings of length greater
> than 1000.
>
> Change-Id: I244ccbd60255e0f3bedc493b1cc3d25cdd42133e
> Bug: v8:9566
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1829273
> Reviewed-by: Peter Marshall <petermarshall@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Ana Pesko <anapesko@google.com>
> Cr-Commit-Position: refs/heads/master@{#64046}

TBR=yangguo@chromium.org,petermarshall@chromium.org,anapesko@google.com

TBR=yangguo@chromium.org

Change-Id: Id8dd362617988c8c5efa87ae157ee91c96cb1fdf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:9566
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1832163Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Commit-Queue: Ana Pesko <anapesko@google.com>
Cr-Commit-Position: refs/heads/master@{#64047}
parent cfb60d43
......@@ -200,10 +200,6 @@ class JSRegExp : public TorqueGeneratedJSRegExp<JSRegExp, JSObject> {
// The uninitialized value for a regexp code object.
static const int kUninitializedValue = -1;
// The heuristic value for the length of the subject string for which we
// tier-up to the compiler immediately, instead of using the interpreter.
static constexpr int kTierUpForSubjectLengthValue = 1000;
TQ_OBJECT_CONSTRUCTORS(JSRegExp)
};
......
......@@ -600,20 +600,6 @@ MaybeHandle<Object> RegExpImpl::IrregexpExec(
}
#endif
// For very long subject strings, the regexp interpreter is currently much
// slower than the jitted code execution. If the tier-up strategy is turned
// on, we want to avoid this performance penalty so we eagerly tier-up if the
// subject string length is equal or greater than the given heuristic value.
if (FLAG_regexp_tier_up &&
subject->length() >= JSRegExp::kTierUpForSubjectLengthValue) {
regexp->MarkTierUpForNextExec();
if (FLAG_trace_regexp_tier_up) {
PrintF(
"Forcing tier-up for very long strings in "
"RegExpImpl::IrregexpExec\n");
}
}
// Prepare space for the return values.
int required_registers = RegExp::IrregexpPrepare(isolate, regexp, subject);
if (required_registers < 0) {
......
......@@ -91,15 +91,3 @@ assertTrue(!%RegexpHasBytecode(re_g, kLatin1) &&
%RegexpHasNativeCode(re_g, kLatin1));
assertTrue(!%RegexpHasBytecode(re_g, kUnicode) &&
!%RegexpHasNativeCode(re_g, kUnicode));
// Testing eager tier-up for very long strings.
let dna = "ATCG".repeat(251);
re_g = />.*\n|\n/;
CheckRegexpNotYetCompiled(re_g);
dna = dna.replace(re_g,"");
assertTrue(!%RegexpHasBytecode(re_g, kLatin1) &&
%RegexpHasNativeCode(re_g, kLatin1));
assertTrue(!%RegexpHasBytecode(re_g, kUnicode) &&
!%RegexpHasNativeCode(re_g, kUnicode));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment