Index: src/arm64/code-stubs-arm64.cc |
diff --git a/src/arm64/code-stubs-arm64.cc b/src/arm64/code-stubs-arm64.cc |
index e86135294f70c947c34e7f8ae214376de0fb95b0..810f3aa7c831c3d4693653f0d9d7626f19904e81 100644 |
--- a/src/arm64/code-stubs-arm64.cc |
+++ b/src/arm64/code-stubs-arm64.cc |
@@ -2941,7 +2941,6 @@ |
// -- ... |
// -- sp[(argc - 1) * 8] : first argument |
// -- sp[argc * 8] : receiver |
- // -- sp[(argc + 1) * 8] : accessor_holder |
// ----------------------------------- |
Register callee = x0; |
@@ -2970,29 +2969,18 @@ |
// context, callee and call data. |
__ Push(context, callee, call_data); |
- Register scratch = call_data; |
- __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); |
+ if (!is_lazy()) { |
+ // Load context from callee |
+ __ Ldr(context, FieldMemOperand(callee, JSFunction::kContextOffset)); |
+ } |
+ |
+ __ LoadRoot(call_data, Heap::kUndefinedValueRootIndex); |
Register isolate_reg = x5; |
__ Mov(isolate_reg, ExternalReference::isolate_address(masm->isolate())); |
// FunctionCallbackArguments: |
// return value, return value default, isolate, holder. |
- __ Push(scratch, scratch, isolate_reg, holder); |
- |
- // Enter a new context |
- if (is_lazy()) { |
- // Load context from accessor_holder |
- Register accessor_holder = context; |
- __ Ldr(accessor_holder, |
- MemOperand(__ StackPointer(), |
- (FCA::kArgsLength + 1 + argc()) * kPointerSize)); |
- __ Ldr(scratch, FieldMemOperand(accessor_holder, HeapObject::kMapOffset)); |
- __ GetMapConstructor(scratch, scratch, context, callee); |
- __ Ldr(context, FieldMemOperand(scratch, JSFunction::kContextOffset)); |
- } else { |
- // Load context from callee |
- __ Ldr(context, FieldMemOperand(callee, JSFunction::kContextOffset)); |
- } |
+ __ Push(call_data, call_data, isolate_reg, holder); |
// Prepare arguments. |
Register args = x6; |
@@ -3034,8 +3022,12 @@ |
return_value_offset = 2 + FCA::kReturnValueOffset; |
} |
MemOperand return_value_operand(fp, return_value_offset * kPointerSize); |
- const int stack_space = argc() + FCA::kArgsLength + 2; |
- MemOperand* stack_space_operand = nullptr; |
+ int stack_space = 0; |
+ MemOperand length_operand = |
+ MemOperand(masm->StackPointer(), 3 * kPointerSize); |
+ MemOperand* stack_space_operand = &length_operand; |
+ stack_space = argc() + FCA::kArgsLength + 1; |
+ stack_space_operand = NULL; |
const int spill_offset = 1 + kApiStackSpace; |
CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, |