Index: src/arm/code-stubs-arm.cc |
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc |
index 282a6d87562981a3368c8a8c3e7a26e044afc443..10818ce7026e3cb3fe19371cb10290d249932f5d 100644 |
--- a/src/arm/code-stubs-arm.cc |
+++ b/src/arm/code-stubs-arm.cc |
@@ -5448,7 +5448,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; |
@@ -5526,15 +5526,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); |
} |