diff options
Diffstat (limited to 'deps/v8/src/builtins/regexp-replace.tq')
-rw-r--r-- | deps/v8/src/builtins/regexp-replace.tq | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/deps/v8/src/builtins/regexp-replace.tq b/deps/v8/src/builtins/regexp-replace.tq index cb0038c6b6..f13724b476 100644 --- a/deps/v8/src/builtins/regexp-replace.tq +++ b/deps/v8/src/builtins/regexp-replace.tq @@ -4,7 +4,7 @@ #include 'src/builtins/builtins-regexp-gen.h' -namespace regexp_replace { +namespace regexp { extern builtin StringIndexOf(implicit context: Context)(String, String, Smi): Smi; @@ -23,10 +23,6 @@ namespace regexp_replace { extern macro RegExpBuiltinsAssembler::AdvanceStringIndexFast(String, Smi, bool): Smi; - extern macro - RegExpBuiltinsAssembler::RegExpPrototypeExecBodyWithoutResultFast( - implicit context: Context)(JSReceiver, String): - RegExpMatchInfo labels IfDidNotMatch; transitioning macro RegExpReplaceCallableNoExplicitCaptures(implicit context: Context)( @@ -57,7 +53,7 @@ namespace regexp_replace { // Element represents the matched substring, which is then passed to the // replace function. case (elString: String): { - const replacementObj: Object = + const replacementObj: JSAny = Call(context, replaceFn, Undefined, elString, matchStart, string); const replacement: String = ToString_Inline(context, replacementObj); matchesElements.objects[i] = replacement; @@ -79,7 +75,7 @@ namespace regexp_replace { // The JSArray is expanded into the function args by Reflect.apply(). // TODO(jgruber): Remove indirection through Call->ReflectApply. - const replacementObj: Object = Call( + const replacementObj: JSAny = Call( context, GetReflectApply(), Undefined, replaceFn, Undefined, elArray); // Overwrite the i'th element in the results with the string @@ -146,8 +142,9 @@ namespace regexp_replace { } while (true) { - const match: RegExpMatchInfo = RegExpPrototypeExecBodyWithoutResultFast( - regexp, string) otherwise break; + const match: RegExpMatchInfo = + regexp::RegExpPrototypeExecBodyWithoutResultFast(regexp, string) + otherwise break; const matchStart: Smi = match.GetStartOfCapture(0); const matchEnd: Smi = match.GetEndOfCapture(0); @@ -172,7 +169,7 @@ namespace regexp_replace { } transitioning builtin RegExpReplace(implicit context: Context)( - regexp: FastJSRegExp, string: String, replaceValue: Object): String { + regexp: FastJSRegExp, string: String, replaceValue: JSAny): String { // TODO(pwong): Remove assert when all callers (StringPrototypeReplace) are // from Torque. assert(Is<FastJSRegExp>(regexp)); @@ -184,7 +181,7 @@ namespace regexp_replace { RegExpReplaceFastGlobalCallable(regexp, string, replaceFn) : StringReplaceNonGlobalRegExpWithFunction(string, regexp, replaceFn); } - case (Object): { + case (JSAny): { const stableRegexp: JSRegExp = regexp; const replaceString: String = ToString_Inline(context, replaceValue); @@ -208,7 +205,7 @@ namespace regexp_replace { } transitioning javascript builtin RegExpPrototypeReplace( - js-implicit context: Context, receiver: Object)(...arguments): Object { + js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { const methodName: constexpr string = 'RegExp.prototype.@@replace'; // RegExpPrototypeReplace is a bit of a beast - a summary of dispatch logic: @@ -229,8 +226,8 @@ namespace regexp_replace { // } // } - const string: Object = arguments[0]; - const replaceValue: Object = arguments[1]; + const string: JSAny = arguments[0]; + const replaceValue: JSAny = arguments[1]; // Let rx be the this value. // If Type(rx) is not Object, throw a TypeError exception. |