Index: src/mips64/builtins-mips64.cc |
diff --git a/src/mips64/builtins-mips64.cc b/src/mips64/builtins-mips64.cc |
index c4ae7edee79b0a837e5d4915345b3246fb09a0c4..3c31bf10a5ee71e062a6e6584abbe3ca4d71f658 100644 |
--- a/src/mips64/builtins-mips64.cc |
+++ b/src/mips64/builtins-mips64.cc |
@@ -2751,6 +2751,24 @@ void Builtins::Generate_AllocateInOldSpace(MacroAssembler* masm) { |
__ TailCallRuntime(Runtime::kAllocateInTargetSpace); |
} |
+// static |
+void Builtins::Generate_StringToNumber(MacroAssembler* masm) { |
+ // The StringToNumber stub takes on argument in a0. |
+ __ AssertString(a0); |
+ |
+ // Check if string has a cached array index. |
+ Label runtime; |
+ __ lwu(a2, FieldMemOperand(a0, String::kHashFieldOffset)); |
+ __ And(at, a2, Operand(String::kContainsCachedArrayIndexMask)); |
+ __ Branch(&runtime, ne, at, Operand(zero_reg)); |
+ __ IndexFromHash(a2, v0); |
+ __ Ret(); |
+ |
+ __ bind(&runtime); |
+ __ Push(a0); // Push argument. |
+ __ TailCallRuntime(Runtime::kStringToNumber); |
+} |
+ |
void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
// State setup as expected by MacroAssembler::InvokePrologue. |
// ----------- S t a t e ------------- |