From 17b5b71bf78ece769194b5350452cf1566369449 Mon Sep 17 00:00:00 2001 From: "balazs.kilvady@imgtec.com" Date: Thu, 16 Oct 2014 16:39:51 +0000 Subject: [PATCH] MIPS: Eliminate special keyed load string stub in favor of uniform handlers. Port r24661 (5499efb) Original commit message: KeyedLoadIC installs a special case if the receiver is a string. Although there are several maps for strings, in practice we seem to be able to treat them individually because a given KeyedLoad site only sees 1-2 string types. BUG= R=paul.lind@imgtec.com Review URL: https://codereview.chromium.org/657413002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24668 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/ic/mips64/ic-mips64.cc | 26 -------------------------- src/mips64/code-stubs-mips64.cc | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/src/ic/mips64/ic-mips64.cc b/src/ic/mips64/ic-mips64.cc index 0bed35e..fd0501a 100644 --- a/src/ic/mips64/ic-mips64.cc +++ b/src/ic/mips64/ic-mips64.cc @@ -599,32 +599,6 @@ void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { } -void KeyedLoadIC::GenerateString(MacroAssembler* masm) { - // Return address is in ra. - Label miss; - - Register receiver = LoadDescriptor::ReceiverRegister(); - Register index = LoadDescriptor::NameRegister(); - Register scratch = a3; - Register result = v0; - DCHECK(!scratch.is(receiver) && !scratch.is(index)); - - StringCharAtGenerator char_at_generator(receiver, index, scratch, result, - &miss, // When not a string. - &miss, // When not a number. - &miss, // When index out of range. - STRING_INDEX_IS_ARRAY_INDEX); - char_at_generator.GenerateFast(masm); - __ Ret(); - - StubRuntimeCallHelper call_helper; - char_at_generator.GenerateSlow(masm, call_helper); - - __ bind(&miss); - GenerateMiss(masm); -} - - static void KeyedStoreGenerateGenericHelper( MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length, diff --git a/src/mips64/code-stubs-mips64.cc b/src/mips64/code-stubs-mips64.cc index 867c24d..d570c58 100644 --- a/src/mips64/code-stubs-mips64.cc +++ b/src/mips64/code-stubs-mips64.cc @@ -1405,6 +1405,34 @@ void JSEntryStub::Generate(MacroAssembler* masm) { } +void LoadIndexedStringStub::Generate(MacroAssembler* masm) { + // Return address is in ra. + Label miss; + + Register receiver = LoadDescriptor::ReceiverRegister(); + Register index = LoadDescriptor::NameRegister(); + Register scratch = a3; + Register result = v0; + DCHECK(!scratch.is(receiver) && !scratch.is(index)); + + StringCharAtGenerator char_at_generator(receiver, index, scratch, result, + &miss, // When not a string. + &miss, // When not a number. + &miss, // When index out of range. + STRING_INDEX_IS_ARRAY_INDEX, + RECEIVER_IS_STRING); + char_at_generator.GenerateFast(masm); + __ Ret(); + + StubRuntimeCallHelper call_helper; + char_at_generator.GenerateSlow(masm, call_helper); + + __ bind(&miss); + PropertyAccessCompiler::TailCallBuiltin( + masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); +} + + // Uses registers a0 to a4. // Expected input (depending on whether args are in registers or on the stack): // * object: a0 or at sp + 1 * kPointerSize. -- 2.7.4