From 127cafa84611dde9c53d62c58d6419be7ff61e38 Mon Sep 17 00:00:00 2001 From: "dcarney@chromium.org" Date: Mon, 17 Feb 2014 12:36:44 +0000 Subject: [PATCH] Remove arch specific api callback generate functions R=verwaest@chromium.org BUG= Review URL: https://codereview.chromium.org/169353002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19406 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/a64/stub-cache-a64.cc | 42 ++++++++---------------------------------- src/arm/stub-cache-arm.cc | 43 ++++++++----------------------------------- src/ia32/stub-cache-ia32.cc | 43 ++++++++----------------------------------- src/stub-cache.cc | 22 ++++++++++++++++++++-- src/stub-cache.h | 9 +++++++++ src/x64/stub-cache-x64.cc | 43 ++++++++----------------------------------- 6 files changed, 61 insertions(+), 141 deletions(-) diff --git a/src/a64/stub-cache-a64.cc b/src/a64/stub-cache-a64.cc index b1e9130..544f38c 100644 --- a/src/a64/stub-cache-a64.cc +++ b/src/a64/stub-cache-a64.cc @@ -745,14 +745,14 @@ static void CompileCallLoadPropertyWithInterceptor( // Generate call to api function. -static void GenerateFastApiCall(MacroAssembler* masm, - const CallOptimization& optimization, - Handle receiver_map, - Register receiver, - Register scratch, - bool is_store, - int argc, - Register* values) { +void StubCompiler::GenerateFastApiCall(MacroAssembler* masm, + const CallOptimization& optimization, + Handle receiver_map, + Register receiver, + Register scratch, + bool is_store, + int argc, + Register* values) { ASSERT(!AreAliased(receiver, scratch)); MacroAssembler::PushPopQueue queue(masm); @@ -1047,15 +1047,6 @@ void LoadStubCompiler::GenerateLoadConstant(Handle value) { void LoadStubCompiler::GenerateLoadCallback( - const CallOptimization& call_optimization, - Handle receiver_map) { - GenerateFastApiCall( - masm(), call_optimization, receiver_map, - receiver(), scratch3(), false, 0, NULL); -} - - -void LoadStubCompiler::GenerateLoadCallback( Register reg, Handle callback) { ASSERT(!AreAliased(scratch2(), scratch3(), scratch4(), reg)); @@ -1534,23 +1525,6 @@ Handle KeyedStoreStubCompiler::CompileStorePolymorphic( } -Handle StoreStubCompiler::CompileStoreCallback( - Handle object, - Handle holder, - Handle name, - const CallOptimization& call_optimization) { - HandlerFrontend(IC::CurrentTypeOf(object, isolate()), - receiver(), holder, name); - - Register values[] = { value() }; - GenerateFastApiCall(masm(), call_optimization, handle(object->map()), - receiver(), scratch3(), true, 1, values); - - // Return the generated code. - return GetCode(kind(), Code::FAST, name); -} - - #undef __ #define __ ACCESS_MASM(masm) diff --git a/src/arm/stub-cache-arm.cc b/src/arm/stub-cache-arm.cc index dd60cc9..2883010 100644 --- a/src/arm/stub-cache-arm.cc +++ b/src/arm/stub-cache-arm.cc @@ -783,14 +783,14 @@ static void CompileCallLoadPropertyWithInterceptor( // Generate call to api function. -static void GenerateFastApiCall(MacroAssembler* masm, - const CallOptimization& optimization, - Handle receiver_map, - Register receiver, - Register scratch_in, - bool is_store, - int argc, - Register* values) { +void StubCompiler::GenerateFastApiCall(MacroAssembler* masm, + const CallOptimization& optimization, + Handle receiver_map, + Register receiver, + Register scratch_in, + bool is_store, + int argc, + Register* values) { ASSERT(!receiver.is(scratch_in)); __ push(receiver); // Write the arguments to stack frame. @@ -1077,15 +1077,6 @@ void LoadStubCompiler::GenerateLoadConstant(Handle value) { void LoadStubCompiler::GenerateLoadCallback( - const CallOptimization& call_optimization, - Handle receiver_map) { - GenerateFastApiCall( - masm(), call_optimization, receiver_map, - receiver(), scratch3(), false, 0, NULL); -} - - -void LoadStubCompiler::GenerateLoadCallback( Register reg, Handle callback) { // Build AccessorInfo::args_ list on the stack and push property name below @@ -1261,24 +1252,6 @@ Handle StoreStubCompiler::CompileStoreCallback( } -Handle StoreStubCompiler::CompileStoreCallback( - Handle object, - Handle holder, - Handle name, - const CallOptimization& call_optimization) { - HandlerFrontend(IC::CurrentTypeOf(object, isolate()), - receiver(), holder, name); - - Register values[] = { value() }; - GenerateFastApiCall( - masm(), call_optimization, handle(object->map()), - receiver(), scratch3(), true, 1, values); - - // Return the generated code. - return GetCode(kind(), Code::FAST, name); -} - - #undef __ #define __ ACCESS_MASM(masm) diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc index 0974126..4bc4288 100644 --- a/src/ia32/stub-cache-ia32.cc +++ b/src/ia32/stub-cache-ia32.cc @@ -422,14 +422,14 @@ static void CompileCallLoadPropertyWithInterceptor( // This function uses push() to generate smaller, faster code than // the version above. It is an optimization that should will be removed // when api call ICs are generated in hydrogen. -static void GenerateFastApiCall(MacroAssembler* masm, - const CallOptimization& optimization, - Handle receiver_map, - Register receiver, - Register scratch_in, - bool is_store, - int argc, - Register* values) { +void StubCompiler::GenerateFastApiCall(MacroAssembler* masm, + const CallOptimization& optimization, + Handle receiver_map, + Register receiver, + Register scratch_in, + bool is_store, + int argc, + Register* values) { // Copy return value. __ pop(scratch_in); // receiver @@ -1067,15 +1067,6 @@ void LoadStubCompiler::GenerateLoadField(Register reg, void LoadStubCompiler::GenerateLoadCallback( - const CallOptimization& call_optimization, - Handle receiver_map) { - GenerateFastApiCall( - masm(), call_optimization, receiver_map, - receiver(), scratch1(), false, 0, NULL); -} - - -void LoadStubCompiler::GenerateLoadCallback( Register reg, Handle callback) { // Insert additional parameters into the stack frame above return address. @@ -1264,24 +1255,6 @@ Handle StoreStubCompiler::CompileStoreCallback( } -Handle StoreStubCompiler::CompileStoreCallback( - Handle object, - Handle holder, - Handle name, - const CallOptimization& call_optimization) { - HandlerFrontend(IC::CurrentTypeOf(object, isolate()), - receiver(), holder, name); - - Register values[] = { value() }; - GenerateFastApiCall( - masm(), call_optimization, handle(object->map()), - receiver(), scratch1(), true, 1, values); - - // Return the generated code. - return GetCode(kind(), Code::FAST, name); -} - - #undef __ #define __ ACCESS_MASM(masm) diff --git a/src/stub-cache.cc b/src/stub-cache.cc index 36e59bd..132ed71 100644 --- a/src/stub-cache.cc +++ b/src/stub-cache.cc @@ -947,8 +947,10 @@ Handle LoadStubCompiler::CompileLoadCallback( ASSERT(call_optimization.is_simple_api_call()); Handle callback = call_optimization.constant_function(); CallbackHandlerFrontend(type, receiver(), holder, name, callback); - GenerateLoadCallback(call_optimization, IC::TypeToMap(*type, isolate())); - + Handlereceiver_map = IC::TypeToMap(*type, isolate()); + GenerateFastApiCall( + masm(), call_optimization, receiver_map, + receiver(), scratch1(), false, 0, NULL); // Return the generated code. return GetCode(kind(), Code::FAST, name); } @@ -1127,6 +1129,22 @@ Handle StoreStubCompiler::CompileStoreViaSetter( } +Handle StoreStubCompiler::CompileStoreCallback( + Handle object, + Handle holder, + Handle name, + const CallOptimization& call_optimization) { + HandlerFrontend(IC::CurrentTypeOf(object, isolate()), + receiver(), holder, name); + Register values[] = { value() }; + GenerateFastApiCall( + masm(), call_optimization, handle(object->map()), + receiver(), scratch1(), true, 1, values); + // Return the generated code. + return GetCode(kind(), Code::FAST, name); +} + + Handle KeyedLoadStubCompiler::CompileLoadElement( Handle receiver_map) { ElementsKind elements_kind = receiver_map->elements_kind(); diff --git a/src/stub-cache.h b/src/stub-cache.h index cb59d4c..7eca6bb 100644 --- a/src/stub-cache.h +++ b/src/stub-cache.h @@ -406,6 +406,15 @@ class StubCompiler BASE_EMBEDDED { void GenerateBooleanCheck(Register object, Label* miss); + static void GenerateFastApiCall(MacroAssembler* masm, + const CallOptimization& optimization, + Handle receiver_map, + Register receiver, + Register scratch, + bool is_store, + int argc, + Register* values); + protected: Handle GetCodeWithFlags(Code::Flags flags, const char* name); Handle GetCodeWithFlags(Code::Flags flags, Handle name); diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc index 9064fbd..346d5e8 100644 --- a/src/x64/stub-cache-x64.cc +++ b/src/x64/stub-cache-x64.cc @@ -393,14 +393,14 @@ static void CompileCallLoadPropertyWithInterceptor( // Generate call to api function. -static void GenerateFastApiCall(MacroAssembler* masm, - const CallOptimization& optimization, - Handle receiver_map, - Register receiver, - Register scratch_in, - bool is_store, - int argc, - Register* values) { +void StubCompiler::GenerateFastApiCall(MacroAssembler* masm, + const CallOptimization& optimization, + Handle receiver_map, + Register receiver, + Register scratch_in, + bool is_store, + int argc, + Register* values) { ASSERT(optimization.is_simple_api_call()); __ PopReturnAddressTo(scratch_in); @@ -971,15 +971,6 @@ void LoadStubCompiler::GenerateLoadField(Register reg, void LoadStubCompiler::GenerateLoadCallback( - const CallOptimization& call_optimization, - Handle receiver_map) { - GenerateFastApiCall( - masm(), call_optimization, receiver_map, - receiver(), scratch1(), false, 0, NULL); -} - - -void LoadStubCompiler::GenerateLoadCallback( Register reg, Handle callback) { // Insert additional parameters into the stack frame above return address. @@ -1159,24 +1150,6 @@ Handle StoreStubCompiler::CompileStoreCallback( } -Handle StoreStubCompiler::CompileStoreCallback( - Handle object, - Handle holder, - Handle name, - const CallOptimization& call_optimization) { - HandlerFrontend(IC::CurrentTypeOf(object, isolate()), - receiver(), holder, name); - - Register values[] = { value() }; - GenerateFastApiCall( - masm(), call_optimization, handle(object->map()), - receiver(), scratch1(), true, 1, values); - - // Return the generated code. - return GetCode(kind(), Code::FAST, name); -} - - #undef __ #define __ ACCESS_MASM(masm) -- 2.7.4