Reviewers: danno, mvstanton, paul.l..., gergely.kis.imgtec,
akos.palfi.imgtec, dusmil.imgtec,
Description:
MIPS64: vector-based ICs did not update type feedback counts correctly.
Port r24732 (83e975b)
BUG=v8:3605
LOG=N
Please review this at https://codereview.chromium.org/670543002/
Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+20, -7 lines):
M src/mips64/code-stubs-mips64.cc
M src/mips64/full-codegen-mips64.cc
M src/mips64/lithium-codegen-mips64.cc
Index: src/mips64/code-stubs-mips64.cc
diff --git a/src/mips64/code-stubs-mips64.cc
b/src/mips64/code-stubs-mips64.cc
index
4a867f103434967407ecc97bfb69778b8fa275e4..beb83e9ad39167fe1f8e0ae10e534ec2a0c0dccd
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.
Index: src/mips64/full-codegen-mips64.cc
diff --git a/src/mips64/full-codegen-mips64.cc
b/src/mips64/full-codegen-mips64.cc
index
1a76c52fd29f764222388bff7d8881f29e341a0e..81d7675120ec4a41c07585f1a077560fc8a793c7
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
Index: src/mips64/lithium-codegen-mips64.cc
diff --git a/src/mips64/lithium-codegen-mips64.cc
b/src/mips64/lithium-codegen-mips64.cc
index
b228f0b204dedf87c362f507b04152a6c09e524f..88f6b1809706c2e25da26f156a5239fe8602cb49
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 <class T>
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<TypeFeedbackVector> 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)));
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.