[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: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61380}
This commit is contained in:
Santiago Aboy Solanes 2019-05-03 13:46:25 +01:00 committed by Commit Bot
parent f11129f342
commit c6af9bb358
4 changed files with 6 additions and 16 deletions

View File

@ -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));
}

View File

@ -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:

View File

@ -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());

View File

@ -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();
}