From: balazs.kilvady@imgtec.com Date: Mon, 20 Oct 2014 17:59:59 +0000 (+0000) Subject: MIPS64: vector-based ICs did not update type feedback counts correctly. X-Git-Tag: upstream/4.7.83~6241 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a1ba9fb06f48a7a373c246cb04909d24307ec2f0;p=platform%2Fupstream%2Fv8.git MIPS64: vector-based ICs did not update type feedback counts correctly. Port r24732 (83e975b) BUG=v8:3605 LOG=N R=paul.lind@imgtec.com Review URL: https://codereview.chromium.org/670543002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24746 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/mips64/code-stubs-mips64.cc b/src/mips64/code-stubs-mips64.cc index 4a867f1..beb83e9 100644 --- a/src/mips64/code-stubs-mips64.cc +++ b/src/mips64/code-stubs-mips64.cc @@ -2947,7 +2947,18 @@ void CallICStub::Generate(MacroAssembler* masm) { __ Daddu(a4, a2, Operand(a4)); __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); __ sd(at, FieldMemOperand(a4, FixedArray::kHeaderSize)); - __ Branch(&slow_start); + // We have to update statistics for runtime profiling. + const int with_types_offset = + FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex); + __ ld(a4, FieldMemOperand(a2, with_types_offset)); + __ Dsubu(a4, a4, Operand(Smi::FromInt(1))); + __ sd(a4, FieldMemOperand(a2, with_types_offset)); + const int generic_offset = + FixedArray::OffsetOfElementAt(TypeFeedbackVector::kGenericCountIndex); + __ ld(a4, FieldMemOperand(a2, generic_offset)); + __ Daddu(a4, a4, Operand(Smi::FromInt(1))); + __ Branch(USE_DELAY_SLOT, &slow_start); + __ sd(a4, FieldMemOperand(a2, generic_offset)); // In delay slot. } // We are here because tracing is on or we are going monomorphic. diff --git a/src/mips64/full-codegen-mips64.cc b/src/mips64/full-codegen-mips64.cc index 1a76c52..81d7675 100644 --- a/src/mips64/full-codegen-mips64.cc +++ b/src/mips64/full-codegen-mips64.cc @@ -1176,7 +1176,8 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { __ li(a1, FeedbackVector()); __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); - __ sd(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(slot.ToInt()))); + int vector_index = FeedbackVector()->GetIndex(slot); + __ sd(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(vector_index))); __ li(a1, Operand(Smi::FromInt(1))); // Smi indicates slow check __ ld(a2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object diff --git a/src/mips64/lithium-codegen-mips64.cc b/src/mips64/lithium-codegen-mips64.cc index b228f0b..88f6b18 100644 --- a/src/mips64/lithium-codegen-mips64.cc +++ b/src/mips64/lithium-codegen-mips64.cc @@ -2857,13 +2857,14 @@ void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { template void LCodeGen::EmitVectorLoadICRegisters(T* instr) { DCHECK(FLAG_vector_ics); - Register vector = ToRegister(instr->temp_vector()); - DCHECK(vector.is(VectorLoadICDescriptor::VectorRegister())); - __ li(vector, instr->hydrogen()->feedback_vector()); + Register vector_register = ToRegister(instr->temp_vector()); + DCHECK(vector_register.is(VectorLoadICDescriptor::VectorRegister())); + Handle vector = instr->hydrogen()->feedback_vector(); + __ li(vector_register, vector); // No need to allocate this register. DCHECK(VectorLoadICDescriptor::SlotRegister().is(a0)); - __ li(VectorLoadICDescriptor::SlotRegister(), - Operand(Smi::FromInt(instr->hydrogen()->slot().ToInt()))); + int index = vector->GetIndex(instr->hydrogen()->slot()); + __ li(VectorLoadICDescriptor::SlotRegister(), Operand(Smi::FromInt(index))); }