From 073ab01dbd14eb4358e90a4398a2716e85fa6089 Mon Sep 17 00:00:00 2001 From: "verwaest@chromium.org" Date: Wed, 23 Jan 2013 09:45:48 +0000 Subject: [PATCH] MIPS: Replace special IC builtins and stubs in the map's cache by codestubs. Port r13453 (94525069) BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/12051014 Patch from Akos Palfi . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13466 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/mips/code-stubs-mips.cc | 32 ++++++++++++++++++++++++++++++++ src/mips/ic-mips.cc | 17 ----------------- src/mips/stub-cache-mips.cc | 25 ------------------------- 3 files changed, 32 insertions(+), 42 deletions(-) diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc index a22e7068e7..983c405be5 100644 --- a/src/mips/code-stubs-mips.cc +++ b/src/mips/code-stubs-mips.cc @@ -33,6 +33,7 @@ #include "code-stubs.h" #include "codegen.h" #include "regexp-macro-assembler.h" +#include "stub-cache.h" namespace v8 { namespace internal { @@ -4543,6 +4544,37 @@ void InstanceofStub::Generate(MacroAssembler* masm) { } +void StringLengthStub::Generate(MacroAssembler* masm) { + Label miss; + Register receiver; + if (kind() == Code::KEYED_LOAD_IC) { + // ----------- S t a t e ------------- + // -- ra : return address + // -- a0 : key + // -- a1 : receiver + // ----------------------------------- + __ Branch(&miss, ne, a0, + Operand(masm->isolate()->factory()->length_symbol())); + receiver = a1; + } else { + ASSERT(kind() == Code::LOAD_IC); + // ----------- S t a t e ------------- + // -- a2 : name + // -- ra : return address + // -- a0 : receiver + // -- sp[0] : receiver + // ----------------------------------- + receiver = a0; + } + + StubCompiler::GenerateLoadStringLength(masm, receiver, a3, t0, &miss, + support_wrapper_); + + __ bind(&miss); + StubCompiler::GenerateLoadMiss(masm, kind()); +} + + Register InstanceofStub::left() { return a0; } diff --git a/src/mips/ic-mips.cc b/src/mips/ic-mips.cc index 6d29c1ed53..4409bb98ac 100644 --- a/src/mips/ic-mips.cc +++ b/src/mips/ic-mips.cc @@ -230,23 +230,6 @@ void LoadIC::GenerateArrayLength(MacroAssembler* masm) { } -void LoadIC::GenerateStringLength(MacroAssembler* masm, bool support_wrappers) { - // ----------- S t a t e ------------- - // -- a2 : name - // -- lr : return address - // -- a0 : receiver - // -- sp[0] : receiver - // ----------------------------------- - Label miss; - - StubCompiler::GenerateLoadStringLength(masm, a0, a1, a3, &miss, - support_wrappers); - // Cache miss: Jump to runtime. - __ bind(&miss); - StubCompiler::GenerateLoadMiss(masm, Code::LOAD_IC); -} - - void LoadIC::GenerateFunctionPrototype(MacroAssembler* masm) { // ----------- S t a t e ------------- // -- a2 : name diff --git a/src/mips/stub-cache-mips.cc b/src/mips/stub-cache-mips.cc index c3d8ad55b6..b1af08fbb4 100644 --- a/src/mips/stub-cache-mips.cc +++ b/src/mips/stub-cache-mips.cc @@ -3223,31 +3223,6 @@ Handle KeyedLoadStubCompiler::CompileLoadArrayLength( } -Handle KeyedLoadStubCompiler::CompileLoadStringLength( - Handle name) { - // ----------- S t a t e ------------- - // -- ra : return address - // -- a0 : key - // -- a1 : receiver - // ----------------------------------- - Label miss; - - Counters* counters = masm()->isolate()->counters(); - __ IncrementCounter(counters->keyed_load_string_length(), 1, a2, a3); - - // Check the key is the cached one. - __ Branch(&miss, ne, a0, Operand(name)); - - GenerateLoadStringLength(masm(), a1, a2, a3, &miss, true); - __ bind(&miss); - __ DecrementCounter(counters->keyed_load_string_length(), 1, a2, a3); - - GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); - - return GetCode(Code::CALLBACKS, name); -} - - Handle KeyedLoadStubCompiler::CompileLoadFunctionPrototype( Handle name) { // ----------- S t a t e -------------