Commit b01bb10c authored by Jakob Gruber's avatar Jakob Gruber Committed by V8 LUCI CQ

[regexp] Use appropriate fast path check in String.matchAll

This fast path check protects the IsRegExp() path (which checks
RegExp.prototype[Symbol.match]) and thus we must use the appropriate
ForMatch check instead of the default check.

Fixed: chromium:1238033
Change-Id: I0b7ce280f1fa9bfacf20381d80c84f9513f45163
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3177222
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarPatrick Thier <pthier@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77004}
parent 19efb9e3
...@@ -1185,7 +1185,7 @@ TF_BUILTIN(StringPrototypeMatchAll, StringBuiltinsAssembler) { ...@@ -1185,7 +1185,7 @@ TF_BUILTIN(StringPrototypeMatchAll, StringBuiltinsAssembler) {
// TypeError exception. // TypeError exception.
GotoIf(TaggedIsSmi(maybe_regexp), &next); GotoIf(TaggedIsSmi(maybe_regexp), &next);
TNode<HeapObject> heap_maybe_regexp = CAST(maybe_regexp); TNode<HeapObject> heap_maybe_regexp = CAST(maybe_regexp);
regexp_asm.BranchIfFastRegExp_Strict(context, heap_maybe_regexp, &fast, regexp_asm.BranchIfFastRegExpForMatch(context, heap_maybe_regexp, &fast,
&slow); &slow);
BIND(&fast); BIND(&fast);
......
// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
RegExp.prototype[Symbol.match] = null;
'ab'.matchAll(/./); // Must not throw.
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