diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc index 0318165e08..57cf360ed4 100644 --- a/src/compiler/ast-graph-builder.cc +++ b/src/compiler/ast-graph-builder.cc @@ -1827,7 +1827,7 @@ void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) { feedback_getter); VisitForValueOrNull(it->second->setter); VectorSlotPair feedback_setter = CreateVectorSlotPair( - expr->SlotForHomeObject(it->second->getter, &store_slot_index)); + expr->SlotForHomeObject(it->second->setter, &store_slot_index)); BuildSetHomeObject(environment()->Top(), literal, it->second->setter, feedback_setter); Node* setter = environment()->Pop(); @@ -3504,7 +3504,10 @@ Node* AstGraphBuilder::BuildKeyedStore(Node* object, Node* key, Node* value, const VectorSlotPair& feedback, TypeFeedbackId id) { const Operator* op = javascript()->StoreProperty(language_mode(), feedback); - Node* node = NewNode(op, object, key, value); + Node* node = NewNode(op, object, key, value, BuildLoadFeedbackVector()); + if (FLAG_vector_stores) { + return Record(js_type_feedback_, node, feedback.slot()); + } return Record(js_type_feedback_, node, id); } @@ -3515,7 +3518,10 @@ Node* AstGraphBuilder::BuildNamedStore(Node* object, Handle name, TypeFeedbackId id) { const Operator* op = javascript()->StoreNamed(language_mode(), MakeUnique(name), feedback); - Node* node = NewNode(op, object, value); + Node* node = NewNode(op, object, value, BuildLoadFeedbackVector()); + if (FLAG_vector_stores) { + return Record(js_type_feedback_, node, feedback.slot()); + } return Record(js_type_feedback_, node, id); } diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc index 2f3d50b49d..793727da2c 100644 --- a/src/compiler/js-generic-lowering.cc +++ b/src/compiler/js-generic-lowering.cc @@ -334,9 +334,16 @@ void JSGenericLowering::LowerJSLoadNamed(Node* node) { void JSGenericLowering::LowerJSStoreProperty(Node* node) { CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); + const StorePropertyParameters& p = StorePropertyParametersOf(node->op()); LanguageMode language_mode = OpParameter(node); Callable callable = CodeFactory::KeyedStoreICInOptimizedCode( isolate(), language_mode, UNINITIALIZED); + if (FLAG_vector_stores) { + DCHECK(p.feedback().index() != -1); + node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.feedback().index())); + } else { + node->RemoveInput(3); + } ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite | flags); } @@ -347,6 +354,12 @@ void JSGenericLowering::LowerJSStoreNamed(Node* node) { const StoreNamedParameters& p = StoreNamedParametersOf(node->op()); Callable callable = CodeFactory::StoreIC(isolate(), p.language_mode()); node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); + if (FLAG_vector_stores) { + DCHECK(p.feedback().index() != -1); + node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.feedback().index())); + } else { + node->RemoveInput(3); + } ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite | flags); } diff --git a/src/compiler/js-operator.cc b/src/compiler/js-operator.cc index 3408098faf..afc9fb3dcf 100644 --- a/src/compiler/js-operator.cc +++ b/src/compiler/js-operator.cc @@ -519,7 +519,7 @@ const Operator* JSOperatorBuilder::StoreNamed(LanguageMode language_mode, return new (zone()) Operator1( // -- IrOpcode::kJSStoreNamed, Operator::kNoProperties, // opcode "JSStoreNamed", // name - 2, 1, 1, 0, 1, 2, // counts + 3, 1, 1, 0, 1, 2, // counts parameters); // parameter } @@ -530,7 +530,7 @@ const Operator* JSOperatorBuilder::StoreProperty( return new (zone()) Operator1( // -- IrOpcode::kJSStoreProperty, Operator::kNoProperties, // opcode "JSStoreProperty", // name - 3, 1, 1, 0, 1, 2, // counts + 4, 1, 1, 0, 1, 2, // counts parameters); // parameter } diff --git a/test/unittests/compiler/js-typed-lowering-unittest.cc b/test/unittests/compiler/js-typed-lowering-unittest.cc index bb1198e13d..50c1734c08 100644 --- a/test/unittests/compiler/js-typed-lowering-unittest.cc +++ b/test/unittests/compiler/js-typed-lowering-unittest.cc @@ -736,13 +736,13 @@ TEST_F(JSTypedLoweringTest, JSStorePropertyToExternalTypedArray) { Node* base = HeapConstant(array); Node* value = Parameter(AccessBuilder::ForTypedArrayElement(type, true).type); + Node* vector = UndefinedConstant(); Node* context = UndefinedConstant(); Node* effect = graph()->start(); Node* control = graph()->start(); VectorSlotPair feedback; - Node* node = - graph()->NewNode(javascript()->StoreProperty(language_mode, feedback), - base, key, value, context); + const Operator* op = javascript()->StoreProperty(language_mode, feedback); + Node* node = graph()->NewNode(op, base, key, value, vector, context); for (int i = 0; i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) { node->AppendInput(zone(), EmptyFrameState()); @@ -784,13 +784,13 @@ TEST_F(JSTypedLoweringTest, JSStorePropertyToExternalTypedArrayWithConversion) { Type::Range(kMinInt / element_size, kMaxInt / element_size, zone())); Node* base = HeapConstant(array); Node* value = Parameter(Type::Any()); + Node* vector = UndefinedConstant(); Node* context = UndefinedConstant(); Node* effect = graph()->start(); Node* control = graph()->start(); VectorSlotPair feedback; - Node* node = - graph()->NewNode(javascript()->StoreProperty(language_mode, feedback), - base, key, value, context); + const Operator* op = javascript()->StoreProperty(language_mode, feedback); + Node* node = graph()->NewNode(op, base, key, value, vector, context); for (int i = 0; i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) { node->AppendInput(zone(), EmptyFrameState()); @@ -845,13 +845,13 @@ TEST_F(JSTypedLoweringTest, JSStorePropertyToExternalTypedArrayWithSafeKey) { Node* key = Parameter(Type::Range(min, max, zone())); Node* base = HeapConstant(array); Node* value = Parameter(access.type); + Node* vector = UndefinedConstant(); Node* context = UndefinedConstant(); Node* effect = graph()->start(); Node* control = graph()->start(); VectorSlotPair feedback; - Node* node = - graph()->NewNode(javascript()->StoreProperty(language_mode, feedback), - base, key, value, context); + const Operator* op = javascript()->StoreProperty(language_mode, feedback); + Node* node = graph()->NewNode(op, base, key, value, vector, context); for (int i = 0; i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) { node->AppendInput(zone(), EmptyFrameState());