Commit 728e9cd8 authored by Z Nguyen-Huu's avatar Z Nguyen-Huu Committed by Commit Bot

[builtins] Port RegExpTestFast to Torque

Bug: v8:8976
Change-Id: I67b7f625b125395869ae8df06c47b58e8964911f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1754753
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63257}
parent 39aee06a
......@@ -865,7 +865,6 @@ namespace internal {
TFJ(RegExpPrototypeSourceGetter, 0, kReceiver) \
/* ES #sec-get-regexp.prototype.sticky */ \
TFJ(RegExpPrototypeStickyGetter, 0, kReceiver) \
TFS(RegExpPrototypeTestFast, kReceiver, kString) \
CPP(RegExpPrototypeToString) \
/* ES #sec-get-regexp.prototype.unicode */ \
TFJ(RegExpPrototypeUnicodeGetter, 0, kReceiver) \
......
......@@ -1818,21 +1818,6 @@ TNode<Object> RegExpBuiltinsAssembler::RegExpExec(Node* context, Node* regexp,
return var_result.value();
}
TF_BUILTIN(RegExpPrototypeTestFast, RegExpBuiltinsAssembler) {
TNode<JSRegExp> regexp = CAST(Parameter(Descriptor::kReceiver));
TNode<String> string = CAST(Parameter(Descriptor::kString));
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
Label if_didnotmatch(this);
CSA_ASSERT(this, IsFastRegExpWithOriginalExec(context, regexp));
RegExpPrototypeExecBodyWithoutResult(context, regexp, string, &if_didnotmatch,
true);
Return(TrueConstant());
BIND(&if_didnotmatch);
Return(FalseConstant());
}
TNode<Number> RegExpBuiltinsAssembler::AdvanceStringIndex(
SloppyTNode<String> string, SloppyTNode<Number> index,
SloppyTNode<BoolT> is_unicode, bool is_fastpath) {
......
......@@ -23,4 +23,15 @@ namespace regexp {
const matchIndices = RegExpExec(context, receiver, str);
return SelectBooleanConstant(matchIndices != Null);
}
extern macro RegExpBuiltinsAssembler::IsFastRegExpWithOriginalExec(
implicit context: Context)(JSRegExp): bool;
transitioning builtin RegExpPrototypeTestFast(implicit context: Context)(
receiver: JSRegExp, string: String): Object {
assert(IsFastRegExpWithOriginalExec(receiver));
RegExpPrototypeExecBodyWithoutResultFast(receiver, string)
otherwise return False;
return True;
}
}
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