Index: src/arm64/builtins-arm64.cc |
diff --git a/src/arm64/builtins-arm64.cc b/src/arm64/builtins-arm64.cc |
index 4e69404e02247f968bd03113d5aa3bea7fffaf1c..913b610e37bd4a97028f756b8cfdbf582bafc44e 100644 |
--- a/src/arm64/builtins-arm64.cc |
+++ b/src/arm64/builtins-arm64.cc |
@@ -2782,6 +2782,23 @@ void Builtins::Generate_AllocateInOldSpace(MacroAssembler* masm) { |
__ TailCallRuntime(Runtime::kAllocateInTargetSpace); |
} |
+void Builtins::Generate_StringToNumber(MacroAssembler* masm) { |
+ // The StringToNumber stub takes one argument in x0. |
+ __ AssertString(x0); |
+ |
+ // Check if string has a cached array index. |
+ Label runtime; |
+ __ Ldr(x2, FieldMemOperand(x0, String::kHashFieldOffset)); |
+ __ Tst(x2, Operand(String::kContainsCachedArrayIndexMask)); |
+ __ B(ne, &runtime); |
+ __ IndexFromHash(x2, x0); |
+ __ Ret(); |
+ |
+ __ Bind(&runtime); |
+ __ Push(x0); // Push argument. |
+ __ TailCallRuntime(Runtime::kStringToNumber); |
+} |
+ |
void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
ASM_LOCATION("Builtins::Generate_ArgumentsAdaptorTrampoline"); |
// ----------- S t a t e ------------- |