Revision: 24756
Author:   [email protected]
Date:     Tue Oct 21 08:28:00 2014 UTC
Log: X87: vector-based ICs did not update type feedback counts correctly.

port r24732.

original commit message:

  vector-based ICs did not update type feedback counts correctly.

BUG=
[email protected]

Review URL: https://codereview.chromium.org/669823002

Patch from Chunyang Dai <[email protected]>.
https://code.google.com/p/v8/source/detail?r=24756

Modified:
 /branches/bleeding_edge/src/x87/code-stubs-x87.cc
 /branches/bleeding_edge/src/x87/full-codegen-x87.cc
 /branches/bleeding_edge/src/x87/lithium-codegen-x87.cc

=======================================
--- /branches/bleeding_edge/src/x87/code-stubs-x87.cc Mon Oct 20 04:12:53 2014 UTC +++ /branches/bleeding_edge/src/x87/code-stubs-x87.cc Tue Oct 21 08:28:00 2014 UTC
@@ -1957,6 +1957,13 @@
     __ mov(FieldOperand(ebx, edx, times_half_pointer_size,
                         FixedArray::kHeaderSize),
            Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate)));
+    // We have to update statistics for runtime profiling.
+    const int with_types_offset =
+        FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex);
+ __ sub(FieldOperand(ebx, with_types_offset), Immediate(Smi::FromInt(1)));
+    const int generic_offset =
+ FixedArray::OffsetOfElementAt(TypeFeedbackVector::kGenericCountIndex);
+    __ add(FieldOperand(ebx, generic_offset), Immediate(Smi::FromInt(1)));
     __ jmp(&slow_start);
   }

=======================================
--- /branches/bleeding_edge/src/x87/full-codegen-x87.cc Mon Oct 20 02:00:50 2014 UTC +++ /branches/bleeding_edge/src/x87/full-codegen-x87.cc Tue Oct 21 08:28:00 2014 UTC
@@ -1106,7 +1106,8 @@

// No need for a write barrier, we are storing a Smi in the feedback vector.
   __ LoadHeapObject(ebx, FeedbackVector());
-  __ mov(FieldOperand(ebx, FixedArray::OffsetOfElementAt(slot.ToInt())),
+  int vector_index = FeedbackVector()->GetIndex(slot);
+  __ mov(FieldOperand(ebx, FixedArray::OffsetOfElementAt(vector_index)),
          Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate())));

   __ mov(ebx, Immediate(Smi::FromInt(1)));  // Smi indicates slow check
=======================================
--- /branches/bleeding_edge/src/x87/lithium-codegen-x87.cc Mon Oct 13 01:54:44 2014 UTC +++ /branches/bleeding_edge/src/x87/lithium-codegen-x87.cc Tue Oct 21 08:28:00 2014 UTC
@@ -3126,13 +3126,15 @@
 template <class T>
 void LCodeGen::EmitVectorLoadICRegisters(T* instr) {
   DCHECK(FLAG_vector_ics);
-  Register vector = ToRegister(instr->temp_vector());
-  DCHECK(vector.is(VectorLoadICDescriptor::VectorRegister()));
-  __ mov(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();
+  __ mov(vector_register, vector);
   // No need to allocate this register.
   DCHECK(VectorLoadICDescriptor::SlotRegister().is(eax));
+  int index = vector->GetIndex(instr->hydrogen()->slot());
   __ mov(VectorLoadICDescriptor::SlotRegister(),
-         Immediate(Smi::FromInt(instr->hydrogen()->slot().ToInt())));
+         Immediate(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.

Reply via email to