Index: src/mips/builtins-mips.cc |
diff --git a/src/mips/builtins-mips.cc b/src/mips/builtins-mips.cc |
index b81ef0532b39e0cd11981d6fca0dfaeb05cf938c..90c5cd602bcf6e925d12bff7d213fa660a0ea28c 100644 |
--- a/src/mips/builtins-mips.cc |
+++ b/src/mips/builtins-mips.cc |
@@ -1404,32 +1404,35 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm, |
const int indexOffset, |
const int limitOffset) { |
Label entry, loop; |
- __ lw(a0, MemOperand(fp, indexOffset)); |
+ Register receiver = LoadDescriptor::ReceiverRegister(); |
+ Register key = LoadDescriptor::NameRegister(); |
+ |
+ __ lw(key, MemOperand(fp, indexOffset)); |
__ Branch(&entry); |
- // Load the current argument from the arguments array and push it to the |
- // stack. |
- // a0: current argument index |
+ // Load the current argument from the arguments array. |
__ bind(&loop); |
- __ lw(a1, MemOperand(fp, argumentsOffset)); |
- __ Push(a1, a0); |
+ __ lw(receiver, MemOperand(fp, argumentsOffset)); |
+ |
+ // Use inline caching to speed up access to arguments. |
+ Handle<Code> ic = masm->isolate()->builtins()->KeyedLoadIC_Megamorphic(); |
+ __ Call(ic, RelocInfo::CODE_TARGET); |
- // Call the runtime to access the property in the arguments array. |
- __ CallRuntime(Runtime::kGetProperty, 2); |
__ push(v0); |
// Use inline caching to access the arguments. |
- __ lw(a0, MemOperand(fp, indexOffset)); |
- __ Addu(a0, a0, Operand(1 << kSmiTagSize)); |
- __ sw(a0, MemOperand(fp, indexOffset)); |
+ __ lw(key, MemOperand(fp, indexOffset)); |
+ __ Addu(key, key, Operand(1 << kSmiTagSize)); |
+ __ sw(key, MemOperand(fp, indexOffset)); |
// Test if the copy loop has finished copying all the elements from the |
// arguments object. |
__ bind(&entry); |
__ lw(a1, MemOperand(fp, limitOffset)); |
- __ Branch(&loop, ne, a0, Operand(a1)); |
+ __ Branch(&loop, ne, key, Operand(a1)); |
// On exit, the pushed arguments count is in a0, untagged |
+ __ mov(a0, key); |
__ SmiUntag(a0); |
} |