Chromium Code Reviews| Index: src/x64/builtins-x64.cc |
| diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc |
| index 1a36341a92e63f20c4a830efd6ee3a6260b71c80..50ae46aeb67111646a10966296e8e1492c552d6a 100644 |
| --- a/src/x64/builtins-x64.cc |
| +++ b/src/x64/builtins-x64.cc |
| @@ -1066,10 +1066,12 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) { |
| // Copy all arguments from the array to the stack. |
| Label entry, loop; |
| - __ movp(rax, Operand(rbp, kIndexOffset)); |
| + Register receiver = LoadIC::ReceiverRegister(); |
| + Register key = LoadIC::NameRegister(); |
| + __ movp(key, Operand(rbp, kIndexOffset)); |
| __ jmp(&entry); |
| __ bind(&loop); |
| - __ movp(rdx, Operand(rbp, kArgumentsOffset)); // load arguments |
| + __ movp(receiver, Operand(rbp, kArgumentsOffset)); // load arguments |
| // Use inline caching to speed up access to arguments. |
| Handle<Code> ic = |
| @@ -1083,19 +1085,20 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) { |
| // Push the nth argument. |
| __ Push(rax); |
| - // Update the index on the stack and in register rax. |
| - __ movp(rax, Operand(rbp, kIndexOffset)); |
| - __ SmiAddConstant(rax, rax, Smi::FromInt(1)); |
| - __ movp(Operand(rbp, kIndexOffset), rax); |
| + // Update the index on the stack and in register key. |
| + __ movp(key, Operand(rbp, kIndexOffset)); |
| + __ SmiAddConstant(key, key, Smi::FromInt(1)); |
| + __ movp(Operand(rbp, kIndexOffset), key); |
| __ bind(&entry); |
| - __ cmpp(rax, Operand(rbp, kLimitOffset)); |
| + __ cmpp(key, Operand(rbp, kLimitOffset)); |
| __ j(not_equal, &loop); |
| // Call the function. |
| Label call_proxy; |
| ParameterCount actual(rax); |
| - __ SmiToInteger32(rax, rax); |
| + ASSERT(!key.is(rax)); |
|
Jakob Kummerow
2014/06/26 16:17:10
why does this matter? AFAICS violating the ASSERT
mvstanton
2014/06/30 13:19:09
Done.
|
| + __ SmiToInteger32(rax, key); |
| __ movp(rdi, Operand(rbp, kFunctionOffset)); |
| __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rcx); |
| __ j(not_equal, &call_proxy); |