Index: src/arm/code-stubs-arm.cc |
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc |
index 35928107f2b78551156c05c6cfa3a6190d8a06ce..d85ebdb114c76ba4a3f9a9796d2154814e678ab8 100644 |
--- a/src/arm/code-stubs-arm.cc |
+++ b/src/arm/code-stubs-arm.cc |
@@ -3168,6 +3168,21 @@ void ToNumberStub::Generate(MacroAssembler* masm) { |
} |
+void ToLengthStub::Generate(MacroAssembler* masm) { |
+ // The ToLength stub takes one argument in r0. |
+ Label not_smi; |
+ __ JumpIfNotSmi(r0, ¬_smi); |
+ STATIC_ASSERT(kSmiTag == 0); |
+ __ tst(r0, r0); |
+ __ mov(r0, Operand(0), LeaveCC, lt); |
+ __ Ret(); |
+ __ bind(¬_smi); |
+ |
+ __ push(r0); // Push argument. |
+ __ TailCallRuntime(Runtime::kToLength, 1, 1); |
+} |
+ |
+ |
void ToStringStub::Generate(MacroAssembler* masm) { |
// The ToString stub takes one argument in r0. |
Label is_number; |