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}
This commit is contained in:
parent
8b9924f6ef
commit
e9445d7d48
@ -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> 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);
|
||||
}
|
||||
|
||||
|
@ -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<LanguageMode>(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);
|
||||
}
|
||||
|
@ -519,7 +519,7 @@ const Operator* JSOperatorBuilder::StoreNamed(LanguageMode language_mode,
|
||||
return new (zone()) Operator1<StoreNamedParameters>( // --
|
||||
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<StorePropertyParameters>( // --
|
||||
IrOpcode::kJSStoreProperty, Operator::kNoProperties, // opcode
|
||||
"JSStoreProperty", // name
|
||||
3, 1, 1, 0, 1, 2, // counts
|
||||
4, 1, 1, 0, 1, 2, // counts
|
||||
parameters); // parameter
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user