From: plind44@gmail.com Date: Fri, 14 Feb 2014 17:45:53 +0000 (+0000) Subject: MIPS: api accessor store ics should return passed value. X-Git-Tag: upstream/4.7.83~10697 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=44b21222663ef7110533e3cd0f0c2d5e1db50869;p=platform%2Fupstream%2Fv8.git MIPS: api accessor store ics should return passed value. Port r19380 (114a9ca) BUG= R=plind44@gmail.com Review URL: https://codereview.chromium.org/167083002 Patch from Balazs Kilvady . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19392 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc index 3d4d605..1a3f336 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); } diff --git a/src/mips/stub-cache-mips.cc b/src/mips/stub-cache-mips.cc index 60ab0b8..3d0e1fc 100644 --- a/src/mips/stub-cache-mips.cc +++ b/src/mips/stub-cache-mips.cc @@ -775,6 +775,7 @@ static void GenerateFastApiCall(MacroAssembler* masm, Handle receiver_map, Register receiver, Register scratch_in, + bool is_store, int argc, Register* values) { ASSERT(!receiver.is(scratch_in)); @@ -843,7 +844,7 @@ static void GenerateFastApiCall(MacroAssembler* masm, __ li(api_function_address, Operand(ref)); // Jump to stub. - CallApiFunctionStub stub(true, call_data_undefined, argc); + CallApiFunctionStub stub(is_store, call_data_undefined, argc); __ TailCallStub(&stub); } @@ -1068,7 +1069,7 @@ void LoadStubCompiler::GenerateLoadCallback( Handle receiver_map) { GenerateFastApiCall( masm(), call_optimization, receiver_map, - receiver(), scratch3(), 0, NULL); + receiver(), scratch3(), false, 0, NULL); } @@ -1257,7 +1258,7 @@ Handle StoreStubCompiler::CompileStoreCallback( Register values[] = { value() }; GenerateFastApiCall( masm(), call_optimization, handle(object->map()), - receiver(), scratch3(), 1, values); + receiver(), scratch3(), true, 1, values); // Return the generated code. return GetCode(kind(), Code::FAST, name);