From: palfia@homejinni.com Date: Fri, 6 Sep 2013 17:21:27 +0000 (+0000) Subject: MIPS: store ics for js api accessors. X-Git-Tag: upstream/4.7.83~12622 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=070d18f9ca8c2d12fac461d070b35a0325b58813;p=platform%2Fupstream%2Fv8.git MIPS: store ics for js api accessors. Port r16571 (9266312) BUG= Review URL: https://codereview.chromium.org/23780003 Patch from Balazs Kilvady . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16580 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/mips/stub-cache-mips.cc b/src/mips/stub-cache-mips.cc index 4342a06..cc75a61 100644 --- a/src/mips/stub-cache-mips.cc +++ b/src/mips/stub-cache-mips.cc @@ -917,6 +917,36 @@ static void GenerateFastApiDirectCall(MacroAssembler* masm, kFastApiCallArguments + 1); } + +// Generate call to api function. +static void GenerateFastApiCall(MacroAssembler* masm, + const CallOptimization& optimization, + Register receiver, + Register scratch, + int argc, + Register* values) { + ASSERT(optimization.is_simple_api_call()); + ASSERT(!receiver.is(scratch)); + + const int stack_space = kFastApiCallArguments + argc + 1; + // Assign stack space for the call arguments. + __ Subu(sp, sp, Operand(stack_space * kPointerSize)); + // Write holder to stack frame. + __ sw(receiver, MemOperand(sp, 0)); + // Write receiver to stack frame. + int index = stack_space - 1; + __ sw(receiver, MemOperand(sp, index * kPointerSize)); + // Write the arguments to stack frame. + for (int i = 0; i < argc; i++) { + ASSERT(!receiver.is(values[i])); + ASSERT(!scratch.is(values[i])); + __ sw(receiver, MemOperand(sp, index-- * kPointerSize)); + } + + GenerateFastApiDirectCall(masm, optimization, argc); +} + + class CallInterceptorCompiler BASE_EMBEDDED { public: CallInterceptorCompiler(StubCompiler* stub_compiler, @@ -1375,19 +1405,8 @@ void BaseLoadStubCompiler::GenerateLoadConstant(Handle value) { void BaseLoadStubCompiler::GenerateLoadCallback( const CallOptimization& call_optimization) { - ASSERT(call_optimization.is_simple_api_call()); - - // Assign stack space for the call arguments. - __ Subu(sp, sp, Operand((kFastApiCallArguments + 1) * kPointerSize)); - - int argc = 0; - int api_call_argc = argc + kFastApiCallArguments; - // Write holder to stack frame. - __ sw(receiver(), MemOperand(sp, 0)); - // Write receiver to stack frame. - __ sw(receiver(), MemOperand(sp, api_call_argc * kPointerSize)); - - GenerateFastApiDirectCall(masm(), call_optimization, argc); + GenerateFastApiCall( + masm(), call_optimization, receiver(), scratch3(), 0, NULL); } @@ -2814,6 +2833,24 @@ Handle StoreStubCompiler::CompileStoreCallback( } +Handle StoreStubCompiler::CompileStoreCallback( + Handle object, + Handle holder, + Handle name, + const CallOptimization& call_optimization) { + Label success; + HandlerFrontend(object, receiver(), holder, name, &success); + __ bind(&success); + + Register values[] = { value() }; + GenerateFastApiCall( + masm(), call_optimization, receiver(), scratch3(), 1, values); + + // Return the generated code. + return GetCode(kind(), Code::CALLBACKS, name); +} + + #undef __ #define __ ACCESS_MASM(masm)