Index: src/mips64/code-stubs-mips64.cc |
diff --git a/src/mips64/code-stubs-mips64.cc b/src/mips64/code-stubs-mips64.cc |
index d1bdd7d901b7063beb3407d1a3cb7d407df66d37..bb6deb92c2443d508c53546f00df5daf691dbe11 100644 |
--- a/src/mips64/code-stubs-mips64.cc |
+++ b/src/mips64/code-stubs-mips64.cc |
@@ -3348,6 +3348,23 @@ void ToNumberStub::Generate(MacroAssembler* masm) { |
} |
+void ToLengthStub::Generate(MacroAssembler* masm) { |
+ // The ToLength stub takes on argument in a0. |
+ Label not_smi, positive_smi; |
+ __ JumpIfNotSmi(a0, ¬_smi); |
+ STATIC_ASSERT(kSmiTag == 0); |
+ __ Branch(&positive_smi, ge, a0, Operand(zero_reg)); |
+ __ mov(a0, zero_reg); |
+ __ bind(&positive_smi); |
+ __ Ret(USE_DELAY_SLOT); |
+ __ mov(v0, a0); |
+ __ bind(¬_smi); |
+ |
+ __ push(a0); // Push argument. |
+ __ TailCallRuntime(Runtime::kToLength, 1, 1); |
+} |
+ |
+ |
void ToStringStub::Generate(MacroAssembler* masm) { |
// The ToString stub takes on argument in a0. |
Label is_number; |