TurboFan calls to vector-based ics need to resolve a slot to an index.
authormvstanton@chromium.org <mvstanton@chromium.org>
Fri, 24 Oct 2014 12:39:49 +0000 (12:39 +0000)
committermvstanton@chromium.org <mvstanton@chromium.org>
Fri, 24 Oct 2014 13:12:08 +0000 (13:12 +0000)
This is to cope with the recent division of the TypeFeedbackVector into
Slots and ICSlots.

R=mstarzinger@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#24870}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24870 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/compiler/js-generic-lowering.cc
src/compiler/js-operator.h

index 7f49faf..9240b06 100644 (file)
@@ -275,8 +275,7 @@ void JSGenericLowering::LowerJSLoadProperty(Node* node) {
   const LoadPropertyParameters& p = LoadPropertyParametersOf(node->op());
   Callable callable = CodeFactory::KeyedLoadICInOptimizedCode(isolate());
   if (FLAG_vector_ics) {
-    PatchInsertInput(node, 2,
-                     jsgraph()->SmiConstant(p.feedback().slot().ToInt()));
+    PatchInsertInput(node, 2, jsgraph()->SmiConstant(p.feedback().index()));
     PatchInsertInput(node, 3, jsgraph()->HeapConstant(p.feedback().vector()));
   }
   ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite);
@@ -289,8 +288,7 @@ void JSGenericLowering::LowerJSLoadNamed(Node* node) {
       CodeFactory::LoadICInOptimizedCode(isolate(), p.contextual_mode());
   PatchInsertInput(node, 1, jsgraph()->HeapConstant(p.name()));
   if (FLAG_vector_ics) {
-    PatchInsertInput(node, 2,
-                     jsgraph()->SmiConstant(p.feedback().slot().ToInt()));
+    PatchInsertInput(node, 2, jsgraph()->SmiConstant(p.feedback().index()));
     PatchInsertInput(node, 3, jsgraph()->HeapConstant(p.feedback().vector()));
   }
   ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite);
index b659292..1ce8173 100644 (file)
@@ -104,6 +104,8 @@ class VectorSlotPair {
   Handle<TypeFeedbackVector> vector() const { return vector_; }
   FeedbackVectorICSlot slot() const { return slot_; }
 
+  int index() const { return vector_->GetIndex(slot_); }
+
  private:
   const Handle<TypeFeedbackVector> vector_;
   const FeedbackVectorICSlot slot_;