Commit e9445d7d authored by mvstanton's avatar mvstanton Committed by Commit bot

Vector ICs: Additional Turbofan support

Lowering of stores need the vector and slot if --vector-stores is true.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#29219}
parent 8b9924f6
...@@ -1827,7 +1827,7 @@ void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) { ...@@ -1827,7 +1827,7 @@ void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
feedback_getter); feedback_getter);
VisitForValueOrNull(it->second->setter); VisitForValueOrNull(it->second->setter);
VectorSlotPair feedback_setter = CreateVectorSlotPair( 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, BuildSetHomeObject(environment()->Top(), literal, it->second->setter,
feedback_setter); feedback_setter);
Node* setter = environment()->Pop(); Node* setter = environment()->Pop();
...@@ -3504,7 +3504,10 @@ Node* AstGraphBuilder::BuildKeyedStore(Node* object, Node* key, Node* value, ...@@ -3504,7 +3504,10 @@ Node* AstGraphBuilder::BuildKeyedStore(Node* object, Node* key, Node* value,
const VectorSlotPair& feedback, const VectorSlotPair& feedback,
TypeFeedbackId id) { TypeFeedbackId id) {
const Operator* op = javascript()->StoreProperty(language_mode(), feedback); 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); return Record(js_type_feedback_, node, id);
} }
...@@ -3515,7 +3518,10 @@ Node* AstGraphBuilder::BuildNamedStore(Node* object, Handle<Name> name, ...@@ -3515,7 +3518,10 @@ Node* AstGraphBuilder::BuildNamedStore(Node* object, Handle<Name> name,
TypeFeedbackId id) { TypeFeedbackId id) {
const Operator* op = const Operator* op =
javascript()->StoreNamed(language_mode(), MakeUnique(name), feedback); 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); return Record(js_type_feedback_, node, id);
} }
......
...@@ -334,9 +334,16 @@ void JSGenericLowering::LowerJSLoadNamed(Node* node) { ...@@ -334,9 +334,16 @@ void JSGenericLowering::LowerJSLoadNamed(Node* node) {
void JSGenericLowering::LowerJSStoreProperty(Node* node) { void JSGenericLowering::LowerJSStoreProperty(Node* node) {
CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); CallDescriptor::Flags flags = AdjustFrameStatesForCall(node);
const StorePropertyParameters& p = StorePropertyParametersOf(node->op());
LanguageMode language_mode = OpParameter<LanguageMode>(node); LanguageMode language_mode = OpParameter<LanguageMode>(node);
Callable callable = CodeFactory::KeyedStoreICInOptimizedCode( Callable callable = CodeFactory::KeyedStoreICInOptimizedCode(
isolate(), language_mode, UNINITIALIZED); 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, ReplaceWithStubCall(node, callable,
CallDescriptor::kPatchableCallSite | flags); CallDescriptor::kPatchableCallSite | flags);
} }
...@@ -347,6 +354,12 @@ void JSGenericLowering::LowerJSStoreNamed(Node* node) { ...@@ -347,6 +354,12 @@ void JSGenericLowering::LowerJSStoreNamed(Node* node) {
const StoreNamedParameters& p = StoreNamedParametersOf(node->op()); const StoreNamedParameters& p = StoreNamedParametersOf(node->op());
Callable callable = CodeFactory::StoreIC(isolate(), p.language_mode()); Callable callable = CodeFactory::StoreIC(isolate(), p.language_mode());
node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); 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, ReplaceWithStubCall(node, callable,
CallDescriptor::kPatchableCallSite | flags); CallDescriptor::kPatchableCallSite | flags);
} }
......
...@@ -519,7 +519,7 @@ const Operator* JSOperatorBuilder::StoreNamed(LanguageMode language_mode, ...@@ -519,7 +519,7 @@ const Operator* JSOperatorBuilder::StoreNamed(LanguageMode language_mode,
return new (zone()) Operator1<StoreNamedParameters>( // -- return new (zone()) Operator1<StoreNamedParameters>( // --
IrOpcode::kJSStoreNamed, Operator::kNoProperties, // opcode IrOpcode::kJSStoreNamed, Operator::kNoProperties, // opcode
"JSStoreNamed", // name "JSStoreNamed", // name
2, 1, 1, 0, 1, 2, // counts 3, 1, 1, 0, 1, 2, // counts
parameters); // parameter parameters); // parameter
} }
...@@ -530,7 +530,7 @@ const Operator* JSOperatorBuilder::StoreProperty( ...@@ -530,7 +530,7 @@ const Operator* JSOperatorBuilder::StoreProperty(
return new (zone()) Operator1<StorePropertyParameters>( // -- return new (zone()) Operator1<StorePropertyParameters>( // --
IrOpcode::kJSStoreProperty, Operator::kNoProperties, // opcode IrOpcode::kJSStoreProperty, Operator::kNoProperties, // opcode
"JSStoreProperty", // name "JSStoreProperty", // name
3, 1, 1, 0, 1, 2, // counts 4, 1, 1, 0, 1, 2, // counts
parameters); // parameter parameters); // parameter
} }
......
...@@ -736,13 +736,13 @@ TEST_F(JSTypedLoweringTest, JSStorePropertyToExternalTypedArray) { ...@@ -736,13 +736,13 @@ TEST_F(JSTypedLoweringTest, JSStorePropertyToExternalTypedArray) {
Node* base = HeapConstant(array); Node* base = HeapConstant(array);
Node* value = Node* value =
Parameter(AccessBuilder::ForTypedArrayElement(type, true).type); Parameter(AccessBuilder::ForTypedArrayElement(type, true).type);
Node* vector = UndefinedConstant();
Node* context = UndefinedConstant(); Node* context = UndefinedConstant();
Node* effect = graph()->start(); Node* effect = graph()->start();
Node* control = graph()->start(); Node* control = graph()->start();
VectorSlotPair feedback; VectorSlotPair feedback;
Node* node = const Operator* op = javascript()->StoreProperty(language_mode, feedback);
graph()->NewNode(javascript()->StoreProperty(language_mode, feedback), Node* node = graph()->NewNode(op, base, key, value, vector, context);
base, key, value, context);
for (int i = 0; for (int i = 0;
i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) { i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) {
node->AppendInput(zone(), EmptyFrameState()); node->AppendInput(zone(), EmptyFrameState());
...@@ -784,13 +784,13 @@ TEST_F(JSTypedLoweringTest, JSStorePropertyToExternalTypedArrayWithConversion) { ...@@ -784,13 +784,13 @@ TEST_F(JSTypedLoweringTest, JSStorePropertyToExternalTypedArrayWithConversion) {
Type::Range(kMinInt / element_size, kMaxInt / element_size, zone())); Type::Range(kMinInt / element_size, kMaxInt / element_size, zone()));
Node* base = HeapConstant(array); Node* base = HeapConstant(array);
Node* value = Parameter(Type::Any()); Node* value = Parameter(Type::Any());
Node* vector = UndefinedConstant();
Node* context = UndefinedConstant(); Node* context = UndefinedConstant();
Node* effect = graph()->start(); Node* effect = graph()->start();
Node* control = graph()->start(); Node* control = graph()->start();
VectorSlotPair feedback; VectorSlotPair feedback;
Node* node = const Operator* op = javascript()->StoreProperty(language_mode, feedback);
graph()->NewNode(javascript()->StoreProperty(language_mode, feedback), Node* node = graph()->NewNode(op, base, key, value, vector, context);
base, key, value, context);
for (int i = 0; for (int i = 0;
i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) { i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) {
node->AppendInput(zone(), EmptyFrameState()); node->AppendInput(zone(), EmptyFrameState());
...@@ -845,13 +845,13 @@ TEST_F(JSTypedLoweringTest, JSStorePropertyToExternalTypedArrayWithSafeKey) { ...@@ -845,13 +845,13 @@ TEST_F(JSTypedLoweringTest, JSStorePropertyToExternalTypedArrayWithSafeKey) {
Node* key = Parameter(Type::Range(min, max, zone())); Node* key = Parameter(Type::Range(min, max, zone()));
Node* base = HeapConstant(array); Node* base = HeapConstant(array);
Node* value = Parameter(access.type); Node* value = Parameter(access.type);
Node* vector = UndefinedConstant();
Node* context = UndefinedConstant(); Node* context = UndefinedConstant();
Node* effect = graph()->start(); Node* effect = graph()->start();
Node* control = graph()->start(); Node* control = graph()->start();
VectorSlotPair feedback; VectorSlotPair feedback;
Node* node = const Operator* op = javascript()->StoreProperty(language_mode, feedback);
graph()->NewNode(javascript()->StoreProperty(language_mode, feedback), Node* node = graph()->NewNode(op, base, key, value, vector, context);
base, key, value, context);
for (int i = 0; for (int i = 0;
i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) { i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) {
node->AppendInput(zone(), EmptyFrameState()); node->AppendInput(zone(), EmptyFrameState());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment