Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Unified Diff: src/builtins/builtins-regexp.cc

Issue 2667963002: [stubs] Remove StringIndexOfChar (Closed)
Patch Set: Rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/builtins/builtins-string.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-regexp.cc
diff --git a/src/builtins/builtins-regexp.cc b/src/builtins/builtins-regexp.cc
index 709ccf4c24d822862005f1cf04f164e996441421..0d9d04742701e19afb4322a5de2162fa520b8774 100644
--- a/src/builtins/builtins-regexp.cc
+++ b/src/builtins/builtins-regexp.cc
@@ -2448,11 +2448,12 @@ TF_BUILTIN(RegExpReplace, RegExpBuiltinsAssembler) {
Node* const replace_string =
CallStub(tostring_callable, context, replace_value);
- Node* const dollar_char = Int32Constant('$');
- GotoUnless(SmiEqual(StringIndexOfChar(context, replace_string, dollar_char,
- SmiConstant(0)),
- SmiConstant(-1)),
- &runtime);
+ Callable indexof_callable = CodeFactory::StringIndexOf(isolate());
+ Node* const dollar_string = HeapConstant(
+ isolate()->factory()->LookupSingleCharacterStringFromCode('$'));
+ Node* const dollar_ix = CallStub(indexof_callable, context, replace_string,
+ dollar_string, SmiConstant(0));
+ GotoUnless(SmiEqual(dollar_ix, SmiConstant(-1)), &runtime);
Return(
ReplaceSimpleStringFastPath(context, regexp, string, replace_string));
« no previous file with comments | « no previous file | src/builtins/builtins-string.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698