Commit 1e0a4007 authored by Danylo Boiko's avatar Danylo Boiko Committed by V8 LUCI CQ

[turbofan] FieldAccess's builder/creator function saving

Bug: v8:7327
Change-Id: I4aececd931359785aa806f749dd27029f8ca4ebe
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3840758
Commit-Queue: Danylo Boiko <danielboyko02@gmail.com>
Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82629}
parent b09b5f78
This diff is collapsed.
......@@ -1725,6 +1725,7 @@ base::Optional<Node*> JSCreateLowering::TryAllocateFastLiteral(
Type::Any(),
MachineType::AnyTagged(),
kFullWriteBarrier,
"TryAllocateFastLiteral",
const_field_info};
// Note: the use of RawInobjectPropertyAt (vs. the higher-level
......
......@@ -844,7 +844,7 @@ FieldAccess ForPropertyCellValue(MachineRepresentation representation,
MachineType r = MachineType::TypeForRepresentation(representation);
FieldAccess access = {
kTaggedBase, PropertyCell::kValueOffset, name.object(), map, type, r,
kind};
kind, "PropertyCellValue"};
return access;
}
......@@ -2685,6 +2685,7 @@ JSNativeContextSpecialization::BuildPropertyStore(
field_type,
MachineType::TypeForRepresentation(field_representation),
kFullWriteBarrier,
"BuildPropertyStore",
access_info.GetConstFieldInfo(),
access_mode == AccessMode::kStoreInLiteral};
......@@ -2718,6 +2719,7 @@ JSNativeContextSpecialization::BuildPropertyStore(
Type::OtherInternal(),
MachineType::TaggedPointer(),
kPointerWriteBarrier,
"BuildPropertyStore",
access_info.GetConstFieldInfo(),
access_mode == AccessMode::kStoreInLiteral};
storage = effect =
......
......@@ -236,6 +236,7 @@ Node* PropertyAccessBuilder::BuildLoadDataField(NameRef const& name,
Type::Any(),
MachineType::AnyTagged(),
kPointerWriteBarrier,
"BuildLoadDataField",
field_access.const_field_info};
storage = *effect = graph()->NewNode(
simplified()->LoadField(storage_access), storage, *effect, *control);
......@@ -263,6 +264,7 @@ Node* PropertyAccessBuilder::BuildLoadDataField(NameRef const& name,
Type::OtherInternal(),
MachineType::TaggedPointer(),
kPointerWriteBarrier,
"BuildLoadDataField",
field_access.const_field_info};
storage = *effect = graph()->NewNode(
simplified()->LoadField(storage_access), storage, *effect, *control);
......@@ -297,6 +299,7 @@ Node* PropertyAccessBuilder::BuildLoadDataField(
access_info.field_type(),
MachineType::TypeForRepresentation(field_representation),
kFullWriteBarrier,
"BuildLoadDataField",
access_info.GetConstFieldInfo()};
if (field_representation == MachineRepresentation::kTaggedPointer ||
field_representation == MachineRepresentation::kCompressedPointer) {
......
......@@ -192,7 +192,8 @@ class V8_EXPORT_PRIVATE RawMachineAssembler {
AddNode(simplified()->StoreField(FieldAccess(
BaseTaggedness::kTaggedBase, offset, MaybeHandle<Name>(),
MaybeHandle<Map>(), Type::Any(),
MachineType::TypeForRepresentation(rep), write_barrier)),
MachineType::TypeForRepresentation(rep), write_barrier,
"OptimizedStoreField")),
object, value);
}
void OptimizedStoreMap(Node* object, Node* value,
......
......@@ -77,7 +77,11 @@ size_t hash_value(FieldAccess const& access) {
}
std::ostream& operator<<(std::ostream& os, FieldAccess const& access) {
os << "[" << access.base_is_tagged << ", " << access.offset << ", ";
os << "[";
if (access.creator_mnemonic != nullptr) {
os << access.creator_mnemonic << ", ";
}
os << access.base_is_tagged << ", " << access.offset << ", ";
#ifdef OBJECT_PRINT
Handle<Name> name;
if (access.name.ToHandle(&name)) {
......
......@@ -78,9 +78,10 @@ struct FieldAccess {
Type type; // type of the field.
MachineType machine_type; // machine type of the field.
WriteBarrierKind write_barrier_kind; // write barrier hint.
ConstFieldInfo const_field_info; // the constness of this access, and the
// field owner map, if the access is const
bool is_store_in_literal; // originates from a kStoreInLiteral access
const char* creator_mnemonic; // store the name of factory/creator method
ConstFieldInfo const_field_info;// the constness of this access, and the
// field owner map, if the access is const
bool is_store_in_literal; // originates from a kStoreInLiteral access
ExternalPointerTag external_pointer_tag = kExternalPointerNullTag;
bool maybe_initializing_or_transitioning_store; // store is potentially
// initializing a newly
......@@ -93,6 +94,7 @@ struct FieldAccess {
type(Type::None()),
machine_type(MachineType::None()),
write_barrier_kind(kFullWriteBarrier),
creator_mnemonic(nullptr),
const_field_info(ConstFieldInfo::None()),
is_store_in_literal(false),
maybe_initializing_or_transitioning_store(false) {}
......@@ -100,6 +102,7 @@ struct FieldAccess {
FieldAccess(BaseTaggedness base_is_tagged, int offset, MaybeHandle<Name> name,
MaybeHandle<Map> map, Type type, MachineType machine_type,
WriteBarrierKind write_barrier_kind,
const char* creator_mnemonic = nullptr,
ConstFieldInfo const_field_info = ConstFieldInfo::None(),
bool is_store_in_literal = false,
ExternalPointerTag external_pointer_tag = kExternalPointerNullTag,
......@@ -124,6 +127,11 @@ struct FieldAccess {
(write_barrier_kind == kMapWriteBarrier ||
write_barrier_kind == kNoWriteBarrier ||
write_barrier_kind == kAssertNoWriteBarrier));
#if !defined(OFFICIAL_BUILD)
this->creator_mnemonic = creator_mnemonic;
#else
this->creator_mnemonic = nullptr;
#endif
}
int tag() const { return base_is_tagged == kTaggedBase ? kHeapObjectTag : 0; }
......
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