| Index: src/x64/code-stubs-x64.cc
|
| diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
|
| index 2df677fad10722a4f8ed5f8462441e5ba0617f36..481e100c77361db3b333794d1e82e34e5f19aa32 100644
|
| --- a/src/x64/code-stubs-x64.cc
|
| +++ b/src/x64/code-stubs-x64.cc
|
| @@ -3122,6 +3122,25 @@ void ToNumberStub::Generate(MacroAssembler* masm) {
|
| }
|
|
|
|
|
| +void ToLengthStub::Generate(MacroAssembler* masm) {
|
| + // The ToLength stub takes on argument in rax.
|
| + Label not_smi, positive_smi;
|
| + __ JumpIfNotSmi(rax, ¬_smi, Label::kNear);
|
| + STATIC_ASSERT(kSmiTag == 0);
|
| + __ testp(rax, rax);
|
| + __ j(greater_equal, &positive_smi, Label::kNear);
|
| + __ xorl(rax, rax);
|
| + __ bind(&positive_smi);
|
| + __ Ret();
|
| + __ bind(¬_smi);
|
| +
|
| + __ PopReturnAddressTo(rcx); // Pop return address.
|
| + __ Push(rax); // Push argument.
|
| + __ PushReturnAddressFrom(rcx); // Push return address.
|
| + __ TailCallRuntime(Runtime::kToLength, 1, 1);
|
| +}
|
| +
|
| +
|
| void ToStringStub::Generate(MacroAssembler* masm) {
|
| // The ToString stub takes one argument in rax.
|
| Label is_number;
|
|
|