From 59d96519318789b0fa0a2260b6cb4256cad1586b Mon Sep 17 00:00:00 2001 From: "mvstanton@chromium.org" Date: Fri, 24 Oct 2014 12:39:49 +0000 Subject: [PATCH] TurboFan calls to vector-based ics need to resolve a slot to an index. 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 | 6 ++---- src/compiler/js-operator.h | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc index 7f49faf..9240b06 100644 --- a/src/compiler/js-generic-lowering.cc +++ b/src/compiler/js-generic-lowering.cc @@ -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); diff --git a/src/compiler/js-operator.h b/src/compiler/js-operator.h index b659292..1ce8173 100644 --- a/src/compiler/js-operator.h +++ b/src/compiler/js-operator.h @@ -104,6 +104,8 @@ class VectorSlotPair { Handle vector() const { return vector_; } FeedbackVectorICSlot slot() const { return slot_; } + int index() const { return vector_->GetIndex(slot_); } + private: const Handle vector_; const FeedbackVectorICSlot slot_; -- 2.7.4