[Turbofan][ptr-compr] Change native context specialisation for CompressedSigned
This CL adds the representation changes from/to CompressedSigned to the other data types (excluding Tagged, which was done in a previous CL). 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: If967a1a0fc669c45a2764cf950cf02d8c06b08b1 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1547859 Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org> Cr-Commit-Position: refs/heads/master@{#60903}
This commit is contained in:
parent
75e2bea3a8
commit
dd29683f53
@ -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()) {
|
||||
|
@ -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);
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user