| Index: src/a64/code-stubs-a64.cc
|
| diff --git a/src/a64/code-stubs-a64.cc b/src/a64/code-stubs-a64.cc
|
| index 269b97f41c17fe8d4107bceb1fbaf832977aabeb..40aa0b617a4b5a625150126c4fe2cbae8a47bf68 100644
|
| --- a/src/a64/code-stubs-a64.cc
|
| +++ b/src/a64/code-stubs-a64.cc
|
| @@ -5581,7 +5581,7 @@ void CallApiFunctionStub::Generate(MacroAssembler* masm) {
|
| Register context = cp;
|
|
|
| int argc = ArgumentBits::decode(bit_field_);
|
| - bool restore_context = RestoreContextBits::decode(bit_field_);
|
| + bool is_store = IsStoreBits::decode(bit_field_);
|
| bool call_data_undefined = CallDataUndefinedBits::decode(bit_field_);
|
|
|
| typedef FunctionCallbackArguments FCA;
|
| @@ -5654,8 +5654,10 @@ void CallApiFunctionStub::Generate(MacroAssembler* masm) {
|
| AllowExternalCallThatCantCauseGC scope(masm);
|
| MemOperand context_restore_operand(
|
| fp, (2 + FCA::kContextSaveIndex) * kPointerSize);
|
| - MemOperand return_value_operand(fp,
|
| - (2 + FCA::kReturnValueOffset) * kPointerSize);
|
| + // Stores return the first js argument
|
| + int return_value_offset =
|
| + 2 + (is_store ? FCA::kArgsLength : FCA::kReturnValueOffset);
|
| + MemOperand return_value_operand(fp, return_value_offset * kPointerSize);
|
|
|
| const int spill_offset = 1 + kApiStackSpace;
|
| __ CallApiFunctionAndReturn(api_function_address,
|
| @@ -5663,8 +5665,7 @@ void CallApiFunctionStub::Generate(MacroAssembler* masm) {
|
| kStackUnwindSpace,
|
| spill_offset,
|
| return_value_operand,
|
| - restore_context ?
|
| - &context_restore_operand : NULL);
|
| + &context_restore_operand);
|
| }
|
|
|
|
|
|
|