From 74c7fda91577b2e549d92879ee1fb63a4daef65a Mon Sep 17 00:00:00 2001 From: "verwaest@chromium.org" Date: Mon, 18 Nov 2013 13:07:44 +0000 Subject: [PATCH] Remove keyed load "force generic" miss case. BUG= R=ishell@chromium.org Review URL: https://chromiumcodereview.appspot.com/68213024 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17828 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/ic-arm.cc | 13 ++++++------- src/arm/stub-cache-arm.cc | 8 ++++---- src/builtins.cc | 7 +------ src/builtins.h | 2 -- src/ia32/ic-ia32.cc | 14 ++++++-------- src/ia32/stub-cache-ia32.cc | 8 ++++---- src/ic.cc | 18 ------------------ src/ic.h | 18 +++--------------- src/mips/ic-mips.cc | 13 ++++++------- src/mips/stub-cache-mips.cc | 8 ++++---- src/x64/ic-x64.cc | 14 ++++++-------- src/x64/stub-cache-x64.cc | 8 ++++---- 12 files changed, 44 insertions(+), 87 deletions(-) diff --git a/src/arm/ic-arm.cc b/src/arm/ic-arm.cc index 23f34d4..f93b04c 100644 --- a/src/arm/ic-arm.cc +++ b/src/arm/ic-arm.cc @@ -827,7 +827,7 @@ void KeyedLoadIC::GenerateNonStrictArguments(MacroAssembler* masm) { __ mov(r0, r2); __ Ret(); __ bind(&slow); - GenerateMiss(masm, MISS); + GenerateMiss(masm); } @@ -887,7 +887,7 @@ void KeyedCallIC::GenerateNonStrictArguments(MacroAssembler* masm, } -void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) { +void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { // ---------- S t a t e -------------- // -- lr : return address // -- r0 : key @@ -900,9 +900,8 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) { __ Push(r1, r0); // Perform tail call to the entry. - ExternalReference ref = miss_mode == MISS_FORCE_GENERIC - ? ExternalReference(IC_Utility(kKeyedLoadIC_MissForceGeneric), isolate) - : ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate); + ExternalReference ref = + ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate); __ TailCallExternalReference(ref, 2, 1); } @@ -1120,7 +1119,7 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) { char_at_generator.GenerateSlow(masm, call_helper); __ bind(&miss); - GenerateMiss(masm, MISS); + GenerateMiss(masm); } @@ -1160,7 +1159,7 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { 1); __ bind(&slow); - GenerateMiss(masm, MISS); + GenerateMiss(masm); } diff --git a/src/arm/stub-cache-arm.cc b/src/arm/stub-cache-arm.cc index 88e220e..9f3e079 100644 --- a/src/arm/stub-cache-arm.cc +++ b/src/arm/stub-cache-arm.cc @@ -3140,12 +3140,12 @@ void KeyedLoadStubCompiler::GenerateLoadDictionaryElement( // -- r0 : key // -- r1 : receiver // ----------------------------------- - Label slow, miss_force_generic; + Label slow, miss; Register key = r0; Register receiver = r1; - __ UntagAndJumpIfNotSmi(r2, key, &miss_force_generic); + __ UntagAndJumpIfNotSmi(r2, key, &miss); __ ldr(r4, FieldMemOperand(receiver, JSObject::kElementsOffset)); __ LoadFromNumberDictionary(&slow, r4, key, r0, r2, r3, r5); __ Ret(); @@ -3163,14 +3163,14 @@ void KeyedLoadStubCompiler::GenerateLoadDictionaryElement( TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow); // Miss case, call the runtime. - __ bind(&miss_force_generic); + __ bind(&miss); // ---------- S t a t e -------------- // -- lr : return address // -- r0 : key // -- r1 : receiver // ----------------------------------- - TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); + TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); } diff --git a/src/builtins.cc b/src/builtins.cc index 2b4a08d..655b808 100644 --- a/src/builtins.cc +++ b/src/builtins.cc @@ -1351,12 +1351,7 @@ static void Generate_KeyedLoadIC_Slow(MacroAssembler* masm) { static void Generate_KeyedLoadIC_Miss(MacroAssembler* masm) { - KeyedLoadIC::GenerateMiss(masm, MISS); -} - - -static void Generate_KeyedLoadIC_MissForceGeneric(MacroAssembler* masm) { - KeyedLoadIC::GenerateMiss(masm, MISS_FORCE_GENERIC); + KeyedLoadIC::GenerateMiss(masm); } diff --git a/src/builtins.h b/src/builtins.h index 667ad6a..ec78782 100644 --- a/src/builtins.h +++ b/src/builtins.h @@ -119,8 +119,6 @@ enum BuiltinExtraArguments { Code::kNoExtraICState) \ V(KeyedLoadIC_Miss, BUILTIN, UNINITIALIZED, \ Code::kNoExtraICState) \ - V(KeyedLoadIC_MissForceGeneric, BUILTIN, UNINITIALIZED, \ - Code::kNoExtraICState) \ V(StoreIC_Miss, BUILTIN, UNINITIALIZED, \ Code::kNoExtraICState) \ V(KeyedStoreIC_Miss, BUILTIN, UNINITIALIZED, \ diff --git a/src/ia32/ic-ia32.cc b/src/ia32/ic-ia32.cc index 6ee82b5..53742dc 100644 --- a/src/ia32/ic-ia32.cc +++ b/src/ia32/ic-ia32.cc @@ -611,7 +611,7 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) { char_at_generator.GenerateSlow(masm, call_helper); __ bind(&miss); - GenerateMiss(masm, MISS); + GenerateMiss(masm); } @@ -653,7 +653,7 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { __ TailCallExternalReference(ref, 2, 1); __ bind(&slow); - GenerateMiss(masm, MISS); + GenerateMiss(masm); } @@ -678,7 +678,7 @@ void KeyedLoadIC::GenerateNonStrictArguments(MacroAssembler* masm) { __ mov(eax, unmapped_location); __ Ret(); __ bind(&slow); - GenerateMiss(masm, MISS); + GenerateMiss(masm); } @@ -1396,7 +1396,7 @@ void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { } -void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) { +void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { // ----------- S t a t e ------------- // -- ecx : key // -- edx : receiver @@ -1411,10 +1411,8 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) { __ push(ebx); // return address // Perform tail call to the entry. - ExternalReference ref = miss_mode == MISS_FORCE_GENERIC - ? ExternalReference(IC_Utility(kKeyedLoadIC_MissForceGeneric), - masm->isolate()) - : ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); + ExternalReference ref = + ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); __ TailCallExternalReference(ref, 2, 1); } diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc index b839333..4014420 100644 --- a/src/ia32/stub-cache-ia32.cc +++ b/src/ia32/stub-cache-ia32.cc @@ -3211,11 +3211,11 @@ void KeyedLoadStubCompiler::GenerateLoadDictionaryElement( // -- edx : receiver // -- esp[0] : return address // ----------------------------------- - Label slow, miss_force_generic; + Label slow, miss; // This stub is meant to be tail-jumped to, the receiver must already // have been verified by the caller to not be a smi. - __ JumpIfNotSmi(ecx, &miss_force_generic); + __ JumpIfNotSmi(ecx, &miss); __ mov(ebx, ecx); __ SmiUntag(ebx); __ mov(eax, FieldOperand(edx, JSObject::kElementsOffset)); @@ -3238,13 +3238,13 @@ void KeyedLoadStubCompiler::GenerateLoadDictionaryElement( // ----------------------------------- TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow); - __ bind(&miss_force_generic); + __ bind(&miss); // ----------- S t a t e ------------- // -- ecx : key // -- edx : receiver // -- esp[0] : return address // ----------------------------------- - TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); + TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); } diff --git a/src/ic.cc b/src/ic.cc index c95a423..2f22532 100644 --- a/src/ic.cc +++ b/src/ic.cc @@ -1364,13 +1364,6 @@ Handle KeyedLoadIC::LoadElementStub(Handle receiver) { } -MaybeObject* KeyedLoadIC::LoadForceGeneric(Handle object, - Handle key) { - set_target(*generic_stub()); - return Runtime::GetObjectPropertyOrFail(isolate(), object, key); -} - - MaybeObject* KeyedLoadIC::Load(Handle object, Handle key) { if (MigrateDeprecated(object)) { return Runtime::GetObjectPropertyOrFail(isolate(), object, key); @@ -2119,17 +2112,6 @@ RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure) { } -RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissForceGeneric) { - HandleScope scope(isolate); - ASSERT(args.length() == 2); - KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate); - Handle receiver = args.at(0); - Handle key = args.at(1); - ic.UpdateState(receiver, key); - return ic.LoadForceGeneric(receiver, key); -} - - // Used from ic-.cc. RUNTIME_FUNCTION(MaybeObject*, StoreIC_Miss) { HandleScope scope(isolate); diff --git a/src/ic.h b/src/ic.h index 98d2204..3f5a256 100644 --- a/src/ic.h +++ b/src/ic.h @@ -40,7 +40,6 @@ namespace internal { #define IC_UTIL_LIST(ICU) \ ICU(LoadIC_Miss) \ ICU(KeyedLoadIC_Miss) \ - ICU(KeyedLoadIC_MissForceGeneric) \ ICU(CallIC_Miss) \ ICU(KeyedCallIC_Miss) \ ICU(StoreIC_Miss) \ @@ -469,12 +468,6 @@ class LoadIC: public IC { }; -enum ICMissMode { - MISS_FORCE_GENERIC, - MISS -}; - - class KeyedLoadIC: public LoadIC { public: explicit KeyedLoadIC(FrameDepth depth, Isolate* isolate) @@ -482,20 +475,15 @@ class KeyedLoadIC: public LoadIC { ASSERT(target()->is_keyed_load_stub()); } - MUST_USE_RESULT MaybeObject* LoadForceGeneric(Handle object, - Handle key); - MUST_USE_RESULT MaybeObject* Load(Handle object, Handle key); // Code generator routines. - static void GenerateMiss(MacroAssembler* masm, ICMissMode force_generic); + static void GenerateMiss(MacroAssembler* masm); static void GenerateRuntimeGetProperty(MacroAssembler* masm); - static void GenerateInitialize(MacroAssembler* masm) { - GenerateMiss(masm, MISS); - } + static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } static void GeneratePreMonomorphic(MacroAssembler* masm) { - GenerateMiss(masm, MISS); + GenerateMiss(masm); } static void GenerateGeneric(MacroAssembler* masm); static void GenerateString(MacroAssembler* masm); diff --git a/src/mips/ic-mips.cc b/src/mips/ic-mips.cc index 0cbd0ea..98fb2f7 100644 --- a/src/mips/ic-mips.cc +++ b/src/mips/ic-mips.cc @@ -826,7 +826,7 @@ void KeyedLoadIC::GenerateNonStrictArguments(MacroAssembler* masm) { __ Ret(USE_DELAY_SLOT); __ mov(v0, a2); __ bind(&slow); - GenerateMiss(masm, MISS); + GenerateMiss(masm); } @@ -891,7 +891,7 @@ void KeyedCallIC::GenerateNonStrictArguments(MacroAssembler* masm, } -void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) { +void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { // ---------- S t a t e -------------- // -- ra : return address // -- a0 : key @@ -904,9 +904,8 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) { __ Push(a1, a0); // Perform tail call to the entry. - ExternalReference ref = miss_mode == MISS_FORCE_GENERIC - ? ExternalReference(IC_Utility(kKeyedLoadIC_MissForceGeneric), isolate) - : ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate); + ExternalReference ref = + ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate); __ TailCallExternalReference(ref, 2, 1); } @@ -1131,7 +1130,7 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) { char_at_generator.GenerateSlow(masm, call_helper); __ bind(&miss); - GenerateMiss(masm, MISS); + GenerateMiss(masm); } @@ -1453,7 +1452,7 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { IC_Utility(kKeyedLoadPropertyWithInterceptor), masm->isolate()), 2, 1); __ bind(&slow); - GenerateMiss(masm, MISS); + GenerateMiss(masm); } diff --git a/src/mips/stub-cache-mips.cc b/src/mips/stub-cache-mips.cc index 25edc6d..65f80c8 100644 --- a/src/mips/stub-cache-mips.cc +++ b/src/mips/stub-cache-mips.cc @@ -3149,12 +3149,12 @@ void KeyedLoadStubCompiler::GenerateLoadDictionaryElement( // -- a0 : key // -- a1 : receiver // ----------------------------------- - Label slow, miss_force_generic; + Label slow, miss; Register key = a0; Register receiver = a1; - __ JumpIfNotSmi(key, &miss_force_generic); + __ JumpIfNotSmi(key, &miss); __ lw(t0, FieldMemOperand(receiver, JSObject::kElementsOffset)); __ sra(a2, a0, kSmiTagSize); __ LoadFromNumberDictionary(&slow, t0, a0, v0, a2, a3, t1); @@ -3174,14 +3174,14 @@ void KeyedLoadStubCompiler::GenerateLoadDictionaryElement( TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow); // Miss case, call the runtime. - __ bind(&miss_force_generic); + __ bind(&miss); // ---------- S t a t e -------------- // -- ra : return address // -- a0 : key // -- a1 : receiver // ----------------------------------- - TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); + TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); } diff --git a/src/x64/ic-x64.cc b/src/x64/ic-x64.cc index 0111206..667a523 100644 --- a/src/x64/ic-x64.cc +++ b/src/x64/ic-x64.cc @@ -540,7 +540,7 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) { char_at_generator.GenerateSlow(masm, call_helper); __ bind(&miss); - GenerateMiss(masm, MISS); + GenerateMiss(masm); } @@ -583,7 +583,7 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { 1); __ bind(&slow); - GenerateMiss(masm, MISS); + GenerateMiss(masm); } @@ -1271,7 +1271,7 @@ void KeyedLoadIC::GenerateNonStrictArguments(MacroAssembler* masm) { __ movq(rax, unmapped_location); __ Ret(); __ bind(&slow); - GenerateMiss(masm, MISS); + GenerateMiss(masm); } @@ -1423,7 +1423,7 @@ void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { } -void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) { +void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { // ----------- S t a t e ------------- // -- rax : key // -- rdx : receiver @@ -1439,10 +1439,8 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) { __ PushReturnAddressFrom(rbx); // Perform tail call to the entry. - ExternalReference ref = miss_mode == MISS_FORCE_GENERIC - ? ExternalReference(IC_Utility(kKeyedLoadIC_MissForceGeneric), - masm->isolate()) - : ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); + ExternalReference ref = + ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); __ TailCallExternalReference(ref, 2, 1); } diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc index edfb47b..431bf47 100644 --- a/src/x64/stub-cache-x64.cc +++ b/src/x64/stub-cache-x64.cc @@ -3124,12 +3124,12 @@ void KeyedLoadStubCompiler::GenerateLoadDictionaryElement( // -- rdx : receiver // -- rsp[0] : return address // ----------------------------------- - Label slow, miss_force_generic; + Label slow, miss; // This stub is meant to be tail-jumped to, the receiver must already // have been verified by the caller to not be a smi. - __ JumpIfNotSmi(rax, &miss_force_generic); + __ JumpIfNotSmi(rax, &miss); __ SmiToInteger32(rbx, rax); __ movq(rcx, FieldOperand(rdx, JSObject::kElementsOffset)); @@ -3149,13 +3149,13 @@ void KeyedLoadStubCompiler::GenerateLoadDictionaryElement( // ----------------------------------- TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow); - __ bind(&miss_force_generic); + __ bind(&miss); // ----------- S t a t e ------------- // -- rax : key // -- rdx : receiver // -- rsp[0] : return address // ----------------------------------- - TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); + TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); } -- 2.7.4