From 2820eeb61e3ef721633392d231ec010f9fa27e0b Mon Sep 17 00:00:00 2001 From: "palfia@homejinni.com" Date: Wed, 20 Mar 2013 21:43:30 +0000 Subject: [PATCH] MIPS: Implement many KeyedStoreStubs using Crankshaft Port r14001 (28443693) Original commit message: - Addition of a compiled hydrogen stub for KeyedStores. - Inlining of "grow" stubs into OPTIMIZED_FUNCTIONs - Addition of new "ignore OOB" ic stub that silently swallows out-of-bounds stores to external typed arrays. - Addition of new "copy-on-write" ic stub that inlines allocation and copying operations for cow array - New stub are generated with Crankshaft, so they are automatically inlined into OPTIMIZED_FUNCTIONs BUG= Review URL: https://codereview.chromium.org/12702012 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14018 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/mips/code-stubs-mips.cc | 11 +++++++++++ src/mips/lithium-codegen-mips.cc | 14 +++++++------- src/mips/lithium-codegen-mips.h | 4 ++++ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc index f5908d3..462ee4c 100644 --- a/src/mips/code-stubs-mips.cc +++ b/src/mips/code-stubs-mips.cc @@ -62,6 +62,17 @@ void KeyedLoadFastElementStub::InitializeInterfaceDescriptor( } +void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( + Isolate* isolate, + CodeStubInterfaceDescriptor* descriptor) { + static Register registers[] = { a2, a1, a0 }; + descriptor->register_param_count_ = 3; + descriptor->register_params_ = registers; + descriptor->deoptimization_handler_ = + FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); +} + + void TransitionElementsKindStub::InitializeInterfaceDescriptor( Isolate* isolate, CodeStubInterfaceDescriptor* descriptor) { diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index cd48934..c32be4f 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -237,7 +237,7 @@ bool LCodeGen::GeneratePrologue() { __ sw(a0, target); // Update the write barrier. This clobbers a3 and a0. __ RecordWriteContextSlot( - cp, target.offset(), a0, a3, kRAHasBeenSaved, kSaveFPRegs); + cp, target.offset(), a0, a3, GetRAState(), kSaveFPRegs); } } Comment(";;; End allocate local context"); @@ -2687,7 +2687,7 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { target.offset(), value, scratch0(), - kRAHasBeenSaved, + GetRAState(), kSaveFPRegs, EMIT_REMEMBERED_SET, check_needed); @@ -4030,7 +4030,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { HeapObject::kMapOffset, scratch, temp, - kRAHasBeenSaved, + GetRAState(), kSaveFPRegs, OMIT_REMEMBERED_SET, OMIT_SMI_CHECK); @@ -4049,7 +4049,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { offset, value, scratch, - kRAHasBeenSaved, + GetRAState(), kSaveFPRegs, EMIT_REMEMBERED_SET, check_needed); @@ -4064,7 +4064,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { offset, value, object, - kRAHasBeenSaved, + GetRAState(), kSaveFPRegs, EMIT_REMEMBERED_SET, check_needed); @@ -4275,7 +4275,7 @@ void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) { __ RecordWrite(elements, key, value, - kRAHasBeenSaved, + GetRAState(), kSaveFPRegs, EMIT_REMEMBERED_SET, check_needed); @@ -4326,7 +4326,7 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { __ sw(new_map_reg, FieldMemOperand(object_reg, HeapObject::kMapOffset)); // Write barrier. __ RecordWriteField(object_reg, HeapObject::kMapOffset, new_map_reg, - scratch, kRAHasBeenSaved, kDontSaveFPRegs); + scratch, GetRAState(), kDontSaveFPRegs); } else if (FLAG_compiled_transitions) { PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); __ mov(a0, object_reg); diff --git a/src/mips/lithium-codegen-mips.h b/src/mips/lithium-codegen-mips.h index 1d2a659..bb2003f 100644 --- a/src/mips/lithium-codegen-mips.h +++ b/src/mips/lithium-codegen-mips.h @@ -87,6 +87,10 @@ class LCodeGen BASE_EMBEDDED { return !NeedsEagerFrame() && info()->is_deferred_calling(); } + RAStatus GetRAState() const { + return frame_is_built_ ? kRAHasBeenSaved : kRAHasNotBeenSaved; + } + // Support for converting LOperands to assembler types. // LOperand must be a register. Register ToRegister(LOperand* op) const; -- 2.7.4