Commit eef7b8d6 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[ptr-compr][turbofan] Now using Compressed representation, type and access

Follow -up CL that aims to eliminate the straggler tagged loads and stores.

It includes a lot of access builder changes. There are 8 access
(2 Any and 6 Pointer) that are still remaining as tagged since changing
those to compressed make some tests fail.

Cq-Include-Trybots: luci.v8.try:v8_linux64_pointer_compression_rel_ng
Cq-Include-Trybots: luci.v8.try:v8_linux64_arm64_pointer_compression_rel_ng
Bug: v8:8977, v8:7703
Change-Id: Iad305fd3a2da257764d22bad30b25489f727e676
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588431Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61270}
parent df6029f5
This diff is collapsed.
......@@ -174,11 +174,11 @@ bool PropertyAccessInfo::Merge(PropertyAccessInfo const* that,
case AccessMode::kHas:
case AccessMode::kLoad: {
if (this->field_representation_ != that->field_representation_) {
if (!IsAnyTagged(this->field_representation_) ||
!IsAnyTagged(that->field_representation_)) {
if (!IsAnyCompressedTagged(this->field_representation_) ||
!IsAnyCompressedTagged(that->field_representation_)) {
return false;
}
this->field_representation_ = MachineRepresentation::kTagged;
this->field_representation_ = MachineType::RepCompressedTagged();
}
if (this->field_map_.address() != that->field_map_.address()) {
this->field_map_ = MaybeHandle<Map>();
......@@ -325,23 +325,15 @@ PropertyAccessInfo AccessInfoFactory::ComputeDataFieldAccessInfo(
FieldIndex field_index =
FieldIndex::ForPropertyIndex(*map, index, details_representation);
Type field_type = Type::NonInternal();
#ifdef V8_COMPRESS_POINTERS
MachineRepresentation field_representation =
MachineRepresentation::kCompressed;
#else
MachineRepresentation field_representation = MachineRepresentation::kTagged;
#endif
MachineType::RepCompressedTagged();
MaybeHandle<Map> field_map;
MapRef map_ref(broker(), map);
std::vector<CompilationDependencies::Dependency const*>
unrecorded_dependencies;
if (details_representation.IsSmi()) {
field_type = Type::SignedSmall();
#ifdef V8_COMPRESS_POINTERS
field_representation = MachineRepresentation::kCompressedSigned;
#else
field_representation = MachineRepresentation::kTaggedSigned;
#endif
field_representation = MachineType::RepCompressedTaggedSigned();
map_ref.SerializeOwnDescriptors(); // TODO(neis): Remove later.
unrecorded_dependencies.push_back(
dependencies()->FieldRepresentationDependencyOffTheRecord(map_ref,
......@@ -352,11 +344,7 @@ PropertyAccessInfo AccessInfoFactory::ComputeDataFieldAccessInfo(
} else if (details_representation.IsHeapObject()) {
// Extract the field type from the property details (make sure its
// representation is TaggedPointer to reflect the heap object case).
#ifdef V8_COMPRESS_POINTERS
field_representation = MachineRepresentation::kCompressedPointer;
#else
field_representation = MachineRepresentation::kTaggedPointer;
#endif
field_representation = MachineType::RepCompressedTaggedPointer();
Handle<FieldType> descriptors_field_type(descriptors->GetFieldType(number),
isolate());
if (descriptors_field_type->IsNone()) {
......@@ -689,7 +677,8 @@ PropertyAccessInfo AccessInfoFactory::LookupSpecialFieldAccessor(
FieldIndex field_index;
if (Accessors::IsJSObjectFieldAccessor(isolate(), map, name, &field_index)) {
Type field_type = Type::NonInternal();
MachineRepresentation field_representation = MachineRepresentation::kTagged;
MachineRepresentation field_representation =
MachineType::RepCompressedTagged();
if (map->IsJSArrayMap()) {
DCHECK(
Name::Equals(isolate(), isolate()->factory()->length_string(), name));
......@@ -700,10 +689,10 @@ PropertyAccessInfo AccessInfoFactory::LookupSpecialFieldAccessor(
// case of other arrays.
if (IsDoubleElementsKind(map->elements_kind())) {
field_type = type_cache_->kFixedDoubleArrayLengthType;
field_representation = MachineRepresentation::kTaggedSigned;
field_representation = MachineType::RepCompressedTaggedSigned();
} else if (IsFastElementsKind(map->elements_kind())) {
field_type = type_cache_->kFixedArrayLengthType;
field_representation = MachineRepresentation::kTaggedSigned;
field_representation = MachineType::RepCompressedTaggedSigned();
} else {
field_type = type_cache_->kJSArrayLengthType;
}
......@@ -736,13 +725,14 @@ PropertyAccessInfo AccessInfoFactory::LookupTransition(
details_representation);
Type field_type = Type::NonInternal();
MaybeHandle<Map> field_map;
MachineRepresentation field_representation = MachineRepresentation::kTagged;
MachineRepresentation field_representation =
MachineType::RepCompressedTagged();
MapRef transition_map_ref(broker(), transition_map);
std::vector<CompilationDependencies::Dependency const*>
unrecorded_dependencies;
if (details_representation.IsSmi()) {
field_type = Type::SignedSmall();
field_representation = MachineRepresentation::kTaggedSigned;
field_representation = MachineType::RepCompressedTaggedSigned();
transition_map_ref.SerializeOwnDescriptors(); // TODO(neis): Remove later.
unrecorded_dependencies.push_back(
dependencies()->FieldRepresentationDependencyOffTheRecord(
......@@ -753,7 +743,7 @@ PropertyAccessInfo AccessInfoFactory::LookupTransition(
} else if (details_representation.IsHeapObject()) {
// Extract the field type from the property details (make sure its
// representation is TaggedPointer to reflect the heap object case).
field_representation = MachineRepresentation::kTaggedPointer;
field_representation = MachineType::RepCompressedTaggedPointer();
Handle<FieldType> descriptors_field_type(
transition_map->instance_descriptors()->GetFieldType(number),
isolate());
......
......@@ -4800,7 +4800,7 @@ Reduction JSCallReducer::ReduceArrayIteratorPrototypeNext(Node* node) {
FieldAccess index_access = AccessBuilder::ForJSArrayIteratorNextIndex();
if (IsFixedTypedArrayElementsKind(elements_kind)) {
index_access.type = TypeCache::Get()->kJSTypedArrayLengthType;
index_access.machine_type = MachineType::TaggedSigned();
index_access.machine_type = MachineType::TypeCompressedTaggedSigned();
index_access.write_barrier_kind = kNoWriteBarrier;
} else {
index_access.type = TypeCache::Get()->kJSArrayLengthType;
......
......@@ -1618,7 +1618,7 @@ Node* JSCreateLowering::AllocateFastLiteral(Node* effect, Node* control,
FieldIndex index = boilerplate_map.GetFieldIndexFor(i);
FieldAccess access = {
kTaggedBase, index.offset(), property_name.object(),
MaybeHandle<Map>(), Type::Any(), MachineType::AnyTagged(),
MaybeHandle<Map>(), Type::Any(), MachineType::TypeCompressedTagged(),
kFullWriteBarrier};
Node* value;
if (boilerplate_map.IsUnboxedDoubleField(i)) {
......
......@@ -287,7 +287,7 @@ Node* PropertyAccessBuilder::BuildLoadDataField(
FieldAccess const storage_access = {
kTaggedBase, field_index.offset(),
name.object(), MaybeHandle<Map>(),
Type::OtherInternal(), MachineType::TaggedPointer(),
Type::OtherInternal(), MachineType::TypeCompressedTaggedPointer(),
kPointerWriteBarrier, LoadSensitivity::kCritical};
storage = *effect = graph()->NewNode(
simplified()->LoadField(storage_access), storage, *effect, *control);
......
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