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

[cleanup][turbofan] Updated representation checks

Started as a cleanup of my own CLs but I noticed there were some checks
that I could update as well.

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, v8:9183
Change-Id: I19092347e33324c24ff4396fa35c40a311c45799
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1594557
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61380}
parent f11129f3
......@@ -8137,9 +8137,7 @@ void CodeStubAssembler::Increment(Variable* variable, int value,
ParameterMode mode) {
DCHECK_IMPLIES(mode == INTPTR_PARAMETERS,
variable->rep() == MachineType::PointerRepresentation());
DCHECK_IMPLIES(mode == SMI_PARAMETERS,
variable->rep() == MachineRepresentation::kTagged ||
variable->rep() == MachineRepresentation::kTaggedSigned);
DCHECK_IMPLIES(mode == SMI_PARAMETERS, CanBeTaggedSigned(variable->rep()));
variable->Bind(IntPtrOrSmiAdd(variable->value(),
IntPtrOrSmiConstant(value, mode), mode));
}
......
......@@ -926,13 +926,9 @@ class MachineRepresentationChecker {
MachineRepresentation actual) {
switch (expected) {
case MachineRepresentation::kTagged:
return (actual == MachineRepresentation::kTagged ||
actual == MachineRepresentation::kTaggedSigned ||
actual == MachineRepresentation::kTaggedPointer);
return IsAnyTagged(actual);
case MachineRepresentation::kCompressed:
return (actual == MachineRepresentation::kCompressed ||
actual == MachineRepresentation::kCompressedSigned ||
actual == MachineRepresentation::kCompressedPointer);
return IsAnyCompressed(actual);
case MachineRepresentation::kTaggedSigned:
case MachineRepresentation::kTaggedPointer:
case MachineRepresentation::kCompressedSigned:
......
......@@ -855,9 +855,7 @@ Node* RepresentationChanger::GetFloat64RepresentationFor(
jsgraph()->common()->DeadValue(MachineRepresentation::kFloat64),
unreachable);
}
} else if (output_rep == MachineRepresentation::kTagged ||
output_rep == MachineRepresentation::kTaggedSigned ||
output_rep == MachineRepresentation::kTaggedPointer) {
} else if (IsAnyTagged(output_rep)) {
if (output_type.Is(Type::Undefined())) {
return jsgraph()->Float64Constant(
std::numeric_limits<double>::quiet_NaN());
......
......@@ -2791,8 +2791,7 @@ class RepresentationSelector {
access.machine_type.representation();
// Convert to Smi if possible, such that we can avoid a write barrier.
if ((field_representation == MachineRepresentation::kTagged ||
field_representation == MachineRepresentation::kCompressed) &&
if (field_representation == MachineType::RepCompressedTagged() &&
TypeOf(value_node).Is(Type::SignedSmall())) {
field_representation = MachineType::RepCompressedTaggedSigned();
}
......@@ -2829,8 +2828,7 @@ class RepresentationSelector {
access.machine_type.representation();
// Convert to Smi if possible, such that we can avoid a write barrier.
if ((element_representation == MachineRepresentation::kTagged ||
element_representation == MachineRepresentation::kCompressed) &&
if (element_representation == MachineType::RepCompressedTagged() &&
TypeOf(value_node).Is(Type::SignedSmall())) {
element_representation = MachineType::RepCompressedTaggedSigned();
}
......
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