diff --git a/src/compiler/access-info.cc b/src/compiler/access-info.cc index 31f0bb59dc..3fbedb6cbb 100644 --- a/src/compiler/access-info.cc +++ b/src/compiler/access-info.cc @@ -324,7 +324,11 @@ PropertyAccessInfo AccessInfoFactory::ComputeDataFieldAccessInfo( MapRef map_ref(broker(), map); if (details_representation.IsSmi()) { field_type = Type::SignedSmall(); +#ifdef V8_COMPRESS_POINTERS + field_representation = MachineRepresentation::kCompressedSigned; +#else field_representation = MachineRepresentation::kTaggedSigned; +#endif map_ref.SerializeOwnDescriptors(); // TODO(neis): Remove later. dependencies()->DependOnFieldRepresentation(map_ref, number); } else if (details_representation.IsDouble()) { diff --git a/src/compiler/representation-change.cc b/src/compiler/representation-change.cc index 980917cc1f..79447f0809 100644 --- a/src/compiler/representation-change.cc +++ b/src/compiler/representation-change.cc @@ -601,6 +601,27 @@ Node* RepresentationChanger::GetCompressedSignedRepresentationFor( return TypeError(node, output_rep, output_type, MachineRepresentation::kTaggedSigned); } + } else if (output_rep == MachineRepresentation::kBit) { + // TODO(v8:8977): specialize here and below + node = GetTaggedSignedRepresentationFor(node, output_rep, output_type, + use_node, use_info); + op = machine()->ChangeTaggedSignedToCompressedSigned(); + } else if (IsWord(output_rep)) { + node = GetTaggedSignedRepresentationFor(node, output_rep, output_type, + use_node, use_info); + op = machine()->ChangeTaggedSignedToCompressedSigned(); + } else if (output_rep == MachineRepresentation::kWord64) { + node = GetTaggedSignedRepresentationFor(node, output_rep, output_type, + use_node, use_info); + op = machine()->ChangeTaggedSignedToCompressedSigned(); + } else if (output_rep == MachineRepresentation::kFloat32) { + node = GetTaggedSignedRepresentationFor(node, output_rep, output_type, + use_node, use_info); + op = machine()->ChangeTaggedSignedToCompressedSigned(); + } else if (output_rep == MachineRepresentation::kFloat64) { + node = GetTaggedSignedRepresentationFor(node, output_rep, output_type, + use_node, use_info); + op = machine()->ChangeTaggedSignedToCompressedSigned(); } else { return TypeError(node, output_rep, output_type, MachineRepresentation::kCompressedSigned); @@ -735,6 +756,12 @@ Node* RepresentationChanger::GetFloat32RepresentationFor( node = jsgraph()->graph()->NewNode(op, node); return GetFloat32RepresentationFor(node, MachineRepresentation::kTagged, output_type, truncation); + } else if (output_rep == MachineRepresentation::kCompressedSigned) { + // TODO(v8:8977): Specialise here + op = machine()->ChangeCompressedSignedToTaggedSigned(); + node = jsgraph()->graph()->NewNode(op, node); + return GetFloat32RepresentationFor( + node, MachineRepresentation::kTaggedSigned, output_type, truncation); } else if (output_rep == MachineRepresentation::kFloat64) { op = machine()->TruncateFloat64ToFloat32(); } else if (output_rep == MachineRepresentation::kWord64) { @@ -828,6 +855,13 @@ Node* RepresentationChanger::GetFloat64RepresentationFor( node = jsgraph()->graph()->NewNode(op, node); return GetFloat64RepresentationFor(node, MachineRepresentation::kTagged, output_type, use_node, use_info); + } else if (output_rep == MachineRepresentation::kCompressedSigned) { + // TODO(v8:8977): Specialise here + op = machine()->ChangeCompressedSignedToTaggedSigned(); + node = jsgraph()->graph()->NewNode(op, node); + return GetFloat64RepresentationFor(node, + MachineRepresentation::kTaggedSigned, + output_type, use_node, use_info); } else if (output_rep == MachineRepresentation::kFloat32) { op = machine()->ChangeFloat32ToFloat64(); } else if (output_rep == MachineRepresentation::kWord64) { @@ -982,6 +1016,13 @@ Node* RepresentationChanger::GetWord32RepresentationFor( node = jsgraph()->graph()->NewNode(op, node); return GetWord32RepresentationFor(node, MachineRepresentation::kTagged, output_type, use_node, use_info); + } else if (output_rep == MachineRepresentation::kCompressedSigned) { + // TODO(v8:8977): Specialise here + op = machine()->ChangeCompressedSignedToTaggedSigned(); + node = jsgraph()->graph()->NewNode(op, node); + return GetWord32RepresentationFor(node, + MachineRepresentation::kTaggedSigned, + output_type, use_node, use_info); } else if (output_rep == MachineRepresentation::kWord32) { // Only the checked case should get here, the non-checked case is // handled in GetRepresentationFor. @@ -1101,6 +1142,12 @@ Node* RepresentationChanger::GetBitRepresentationFor( node = jsgraph()->graph()->NewNode(op, node); return GetBitRepresentationFor(node, MachineRepresentation::kTagged, output_type); + } else if (output_rep == MachineRepresentation::kCompressedSigned) { + // TODO(v8:8977): Specialise here + op = machine()->ChangeCompressedSignedToTaggedSigned(); + node = jsgraph()->graph()->NewNode(op, node); + return GetBitRepresentationFor(node, MachineRepresentation::kTaggedSigned, + output_type); } else if (IsWord(output_rep)) { node = jsgraph()->graph()->NewNode(machine()->Word32Equal(), node, jsgraph()->Int32Constant(0)); @@ -1237,6 +1284,13 @@ Node* RepresentationChanger::GetWord64RepresentationFor( node = jsgraph()->graph()->NewNode(op, node); return GetWord64RepresentationFor(node, MachineRepresentation::kTagged, output_type, use_node, use_info); + } else if (output_rep == MachineRepresentation::kCompressedSigned) { + // TODO(v8:8977): Specialise here + op = machine()->ChangeCompressedSignedToTaggedSigned(); + node = jsgraph()->graph()->NewNode(op, node); + return GetWord64RepresentationFor(node, + MachineRepresentation::kTaggedSigned, + output_type, use_node, use_info); } else { return TypeError(node, output_rep, output_type, MachineRepresentation::kWord64); diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc index 1370f5444f..b811543906 100644 --- a/src/compiler/simplified-lowering.cc +++ b/src/compiler/simplified-lowering.cc @@ -1108,6 +1108,10 @@ class RepresentationSelector { if (IsAnyTagged(rep)) { return MachineType::AnyTagged(); } + // Do not distinguish between various Compressed variations. + if (IsAnyCompressed(rep)) { + return MachineType::AnyCompressed(); + } // Word64 representation is only valid for safe integer values. if (rep == MachineRepresentation::kWord64) { DCHECK(type.Is(TypeCache::Get()->kSafeInteger));