[regexp] Remove UseCounter for matchAll with non-g RegExp
We've gathered sufficient data, so the use counter can now be removed again. The use counter was originally added here: - V8 CL: https://chromium-review.googlesource.com/c/v8/v8/+/1718145 - Chromium CL: https://chromium-review.googlesource.com/c/chromium/src/+/1718367 The Chromium plumbing was removed here: https://chromium-review.googlesource.com/c/chromium/src/+/1839851 BUG=v8:9551 Change-Id: I829a0fe34d9ebade1403cb4d1c0b9c997f125074 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1844774 Reviewed-by: Jakob Gruber <jgruber@chromium.org> Commit-Queue: Mathias Bynens <mathias@chromium.org> Cr-Commit-Position: refs/heads/master@{#64124}
This commit is contained in:
parent
e6c1385129
commit
65940f4369
@ -13,9 +13,6 @@ namespace regexp {
|
||||
RegExpMatchAllAssembler::CreateRegExpStringIterator(
|
||||
NativeContext, Object, String, bool, bool): JSAny;
|
||||
|
||||
const kRegExpMatchAllWithNonGlobalRegExp: constexpr int31
|
||||
generates 'v8::Isolate::kRegExpMatchAllWithNonGlobalRegExp';
|
||||
|
||||
@export
|
||||
transitioning macro RegExpPrototypeMatchAllImpl(implicit context: Context)(
|
||||
nativeContext: NativeContext, receiver: JSAny, string: JSAny): JSAny {
|
||||
@ -98,13 +95,6 @@ namespace regexp {
|
||||
}
|
||||
}
|
||||
|
||||
// UseCounter for matchAll with non-g RegExp.
|
||||
// https://crbug.com/v8/9551
|
||||
if (!global) {
|
||||
IncrementUseCounter(
|
||||
context, SmiConstant(kRegExpMatchAllWithNonGlobalRegExp));
|
||||
}
|
||||
|
||||
// 13. Return ! CreateRegExpStringIterator(matcher, S, global, fullUnicode).
|
||||
return CreateRegExpStringIterator(
|
||||
nativeContext, matcher, string, global, unicode);
|
||||
|
@ -1745,19 +1745,6 @@ TEST(UseCountRegExp) {
|
||||
CHECK_EQ(2, use_counts[v8::Isolate::kRegExpPrototypeStickyGetter]);
|
||||
CHECK_EQ(1, use_counts[v8::Isolate::kRegExpPrototypeToString]);
|
||||
CHECK(resultToStringError->IsObject());
|
||||
|
||||
// Increment a UseCounter when .matchAll() is used with a non-global
|
||||
// regular expression.
|
||||
CHECK_EQ(0, use_counts[v8::Isolate::kRegExpMatchAllWithNonGlobalRegExp]);
|
||||
v8::Local<v8::Value> resultReMatchAllNonGlobal =
|
||||
CompileRun("'a'.matchAll(/./)");
|
||||
CHECK_EQ(1, use_counts[v8::Isolate::kRegExpMatchAllWithNonGlobalRegExp]);
|
||||
CHECK(resultReMatchAllNonGlobal->IsObject());
|
||||
// Don't increment the counter for global regular expressions.
|
||||
v8::Local<v8::Value> resultReMatchAllGlobal =
|
||||
CompileRun("'a'.matchAll(/./g)");
|
||||
CHECK_EQ(1, use_counts[v8::Isolate::kRegExpMatchAllWithNonGlobalRegExp]);
|
||||
CHECK(resultReMatchAllGlobal->IsObject());
|
||||
}
|
||||
|
||||
class UncachedExternalString
|
||||
|
Loading…
Reference in New Issue
Block a user