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)); |