Index: src/mips/code-stubs-mips.cc |
diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc |
index 3d4d60516f7042bf3f698f2cc1eb4d3b3d637c5e..1a3f33659854f404a6588caf0aed39ae58797812 100644 |
--- a/src/mips/code-stubs-mips.cc |
+++ b/src/mips/code-stubs-mips.cc |
@@ -5640,7 +5640,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; |
@@ -5707,15 +5707,16 @@ 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); |
__ CallApiFunctionAndReturn(api_function_address, |
thunk_ref, |
kStackUnwindSpace, |
return_value_operand, |
- restore_context ? |
- &context_restore_operand : NULL); |
+ &context_restore_operand); |
} |