Index: src/mips64/code-stubs-mips64.cc |
diff --git a/src/mips64/code-stubs-mips64.cc b/src/mips64/code-stubs-mips64.cc |
index 41f1cc28b95ba7ea38956c14ac9ec9e577c17d0a..df041d34c5d5e8c94361bf7963dcec0a64aa5aa8 100644 |
--- a/src/mips64/code-stubs-mips64.cc |
+++ b/src/mips64/code-stubs-mips64.cc |
@@ -2883,9 +2883,8 @@ |
// -- |
// -- sp[0] : last argument |
// -- ... |
- // -- sp[(argc - 1) * 8] : first argument |
+ // -- sp[(argc - 1)* 8] : first argument |
// -- sp[argc * 8] : receiver |
- // -- sp[(argc + 1) * 8] : accessor_holder |
// ----------------------------------- |
Register callee = a0; |
@@ -2911,6 +2910,10 @@ |
// Save context, callee and call data. |
__ Push(context, callee, call_data); |
+ if (!is_lazy()) { |
+ // Load context from callee. |
+ __ Ld(context, FieldMemOperand(callee, JSFunction::kContextOffset)); |
+ } |
Register scratch = call_data; |
__ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); |
@@ -2919,20 +2922,6 @@ |
__ li(scratch, Operand(ExternalReference::isolate_address(masm->isolate()))); |
// Push isolate and holder. |
__ Push(scratch, holder); |
- |
- // Enter a new context |
- if (is_lazy()) { |
- // Load context from accessor_holder |
- Register accessor_holder = context; |
- __ Ld(accessor_holder, |
- MemOperand(sp, (FCA::kArgsLength + 1 + argc()) * kPointerSize)); |
- __ Ld(scratch, FieldMemOperand(accessor_holder, HeapObject::kMapOffset)); |
- __ GetMapConstructor(scratch, scratch, context, callee); |
- __ Ld(context, FieldMemOperand(scratch, JSFunction::kContextOffset)); |
- } else { |
- // Load context from callee. |
- __ Ld(context, FieldMemOperand(callee, JSFunction::kContextOffset)); |
- } |
// Prepare arguments. |
__ mov(scratch, sp); |
@@ -2974,9 +2963,11 @@ |
return_value_offset = 2 + FCA::kReturnValueOffset; |
} |
MemOperand return_value_operand(fp, return_value_offset * kPointerSize); |
- const int stack_space = argc() + FCA::kArgsLength + 2; |
+ int stack_space = 0; |
+ int32_t stack_space_offset = 3 * kPointerSize; |
+ stack_space = argc() + FCA::kArgsLength + 1; |
// TODO(adamk): Why are we clobbering this immediately? |
- const int32_t stack_space_offset = kInvalidStackOffset; |
+ stack_space_offset = kInvalidStackOffset; |
CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, |
stack_space_offset, return_value_operand, |
&context_restore_operand); |