[ptr-compr] Remove CompressedSigned MachineRepresentation

Since smi-corrputing, TaggedSigned (aka known smis) only have the lower
bits used. This renders CompressedSigned useless.

Bug: v8:7703
Change-Id: Id59aaebc24d670ed32c483ceecf77fd194405ee4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1903445
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64883}
This commit is contained in:
Santiago Aboy Solanes 2019-11-07 17:58:07 +00:00 committed by Commit Bot
parent e1f90f936a
commit 80dc6a3394
16 changed files with 1 additions and 51 deletions

View File

@ -14,7 +14,6 @@ bool IsSubtype(MachineRepresentation rep1, MachineRepresentation rep2) {
case MachineRepresentation::kTaggedSigned: // Fall through.
case MachineRepresentation::kTaggedPointer:
return rep2 == MachineRepresentation::kTagged;
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer:
return rep2 == MachineRepresentation::kCompressed;
default:
@ -52,8 +51,6 @@ const char* MachineReprToString(MachineRepresentation rep) {
return "kRepTaggedPointer";
case MachineRepresentation::kTagged:
return "kRepTagged";
case MachineRepresentation::kCompressedSigned:
return "kRepCompressedSigned";
case MachineRepresentation::kCompressedPointer:
return "kRepCompressedPointer";
case MachineRepresentation::kCompressed:

View File

@ -24,7 +24,6 @@ enum class MachineRepresentation : uint8_t {
kTaggedSigned,
kTaggedPointer,
kTagged,
kCompressedSigned,
kCompressedPointer,
kCompressed,
// FP representations must be last, and in order of increasing size.
@ -106,12 +105,8 @@ class MachineType {
}
constexpr bool IsCompressed() const {
return representation() == MachineRepresentation::kCompressedPointer ||
representation() == MachineRepresentation::kCompressedSigned ||
representation() == MachineRepresentation::kCompressed;
}
constexpr bool IsCompressedSigned() const {
return representation() == MachineRepresentation::kCompressedSigned;
}
constexpr bool IsCompressedPointer() const {
return representation() == MachineRepresentation::kCompressedPointer;
}
@ -181,10 +176,6 @@ class MachineType {
constexpr static MachineType AnyTagged() {
return MachineType(MachineRepresentation::kTagged, MachineSemantic::kAny);
}
constexpr static MachineType CompressedSigned() {
return MachineType(MachineRepresentation::kCompressedSigned,
MachineSemantic::kInt32);
}
constexpr static MachineType CompressedPointer() {
return MachineType(MachineRepresentation::kCompressedPointer,
MachineSemantic::kAny);
@ -271,8 +262,6 @@ class MachineType {
return MachineType::AnyCompressed();
case MachineRepresentation::kCompressedPointer:
return MachineType::CompressedPointer();
case MachineRepresentation::kCompressedSigned:
return MachineType::CompressedSigned();
default:
UNREACHABLE();
}
@ -328,14 +317,8 @@ inline bool CanBeTaggedOrCompressedPointer(MachineRepresentation rep) {
return CanBeTaggedPointer(rep) || CanBeCompressedPointer(rep);
}
inline bool CanBeCompressedSigned(MachineRepresentation rep) {
return rep == MachineRepresentation::kCompressed ||
rep == MachineRepresentation::kCompressedSigned;
}
inline bool IsAnyCompressed(MachineRepresentation rep) {
return CanBeCompressedPointer(rep) ||
rep == MachineRepresentation::kCompressedSigned;
return CanBeCompressedPointer(rep);
}
// Gets the log2 of the element size in bytes of the machine type.
@ -357,7 +340,6 @@ V8_EXPORT_PRIVATE inline int ElementSizeLog2Of(MachineRepresentation rep) {
case MachineRepresentation::kTaggedSigned:
case MachineRepresentation::kTaggedPointer:
case MachineRepresentation::kTagged:
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kCompressed:
return kTaggedSizeLog2;

View File

@ -503,7 +503,6 @@ void InstructionSelector::VisitLoad(Node* node) {
case MachineRepresentation::kSimd128:
opcode = kArmVld1S128;
break;
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kWord64: // Fall through.
@ -584,7 +583,6 @@ void InstructionSelector::VisitStore(Node* node) {
case MachineRepresentation::kSimd128:
opcode = kArmVst1S128;
break;
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kWord64: // Fall through.

View File

@ -619,7 +619,6 @@ void InstructionSelector::VisitLoad(Node* node) {
opcode = kArm64LdrW;
immediate_mode = kLoadStoreImm32;
break;
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed:
#ifdef V8_COMPRESS_POINTERS
@ -736,7 +735,6 @@ void InstructionSelector::VisitStore(Node* node) {
opcode = kArm64StrW;
immediate_mode = kLoadStoreImm32;
break;
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed:
#ifdef V8_COMPRESS_POINTERS

View File

@ -363,7 +363,6 @@ void InstructionSelector::VisitLoad(Node* node) {
case MachineRepresentation::kSimd128:
opcode = kIA32Movdqu;
break;
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kWord64: // Fall through.
@ -444,7 +443,6 @@ void InstructionSelector::VisitStore(Node* node) {
case MachineRepresentation::kSimd128:
opcode = kIA32Movdqu;
break;
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kWord64: // Fall through.

View File

@ -346,7 +346,6 @@ class OperandGenerator {
case MachineRepresentation::kTaggedSigned:
case MachineRepresentation::kTaggedPointer:
case MachineRepresentation::kCompressed:
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
return Constant(static_cast<int32_t>(0));
case MachineRepresentation::kFloat64:

View File

@ -228,9 +228,6 @@ std::ostream& operator<<(std::ostream& os, const InstructionOperand& op) {
case MachineRepresentation::kTagged:
os << "|t";
break;
case MachineRepresentation::kCompressedSigned:
os << "|cs";
break;
case MachineRepresentation::kCompressedPointer:
os << "|cp";
break;
@ -892,7 +889,6 @@ static MachineRepresentation FilterRepresentation(MachineRepresentation rep) {
case MachineRepresentation::kFloat32:
case MachineRepresentation::kFloat64:
case MachineRepresentation::kSimd128:
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kCompressed:
return rep;

View File

@ -472,7 +472,6 @@ class LocationOperand : public InstructionOperand {
case MachineRepresentation::kTaggedSigned:
case MachineRepresentation::kTaggedPointer:
case MachineRepresentation::kTagged:
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kCompressed:
return true;

View File

@ -79,7 +79,6 @@ int GetByteWidth(MachineRepresentation rep) {
case MachineRepresentation::kTaggedSigned:
case MachineRepresentation::kTaggedPointer:
case MachineRepresentation::kTagged:
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kCompressed:
// TODO(ishell): kTaggedSize once half size locations are supported.

View File

@ -241,7 +241,6 @@ ArchOpcode GetLoadOpcode(LoadRepresentation load_rep) {
case MachineRepresentation::kWord32:
opcode = kX64Movl;
break;
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed:
#ifdef V8_COMPRESS_POINTERS
@ -290,7 +289,6 @@ ArchOpcode GetStoreOpcode(StoreRepresentation store_rep) {
return kX64Movw;
case MachineRepresentation::kWord32:
return kX64Movl;
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed:
#ifdef V8_COMPRESS_POINTERS
@ -630,7 +628,6 @@ bool TryMergeTruncateInt64ToInt32IntoLoad(InstructionSelector* selector,
case MachineRepresentation::kWord64:
case MachineRepresentation::kTaggedSigned:
case MachineRepresentation::kTagged:
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
opcode = kX64Movl;
break;

View File

@ -2436,7 +2436,6 @@ JSNativeContextSpecialization::BuildPropertyStore(
break;
case MachineRepresentation::kNone:
case MachineRepresentation::kBit:
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kCompressed:
case MachineRepresentation::kWord8:

View File

@ -1069,7 +1069,6 @@ Reduction LoadElimination::ReduceLoadElement(Node* node) {
case MachineRepresentation::kWord32:
case MachineRepresentation::kWord64:
case MachineRepresentation::kFloat32:
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kCompressed:
// TODO(turbofan): Add support for doing the truncations.
@ -1124,7 +1123,6 @@ Reduction LoadElimination::ReduceStoreElement(Node* node) {
case MachineRepresentation::kWord32:
case MachineRepresentation::kWord64:
case MachineRepresentation::kFloat32:
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kCompressed:
// TODO(turbofan): Add support for doing the truncations.
@ -1427,7 +1425,6 @@ LoadElimination::IndexRange LoadElimination::FieldIndexOf(
case MachineRepresentation::kTaggedSigned:
case MachineRepresentation::kTaggedPointer:
case MachineRepresentation::kTagged:
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kCompressed:
break;

View File

@ -619,7 +619,6 @@ class MachineRepresentationChecker {
break;
case MachineRepresentation::kCompressed:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kCompressedSigned:
for (int i = 0; i < node->op()->ValueInputCount(); ++i) {
CheckValueInputIsCompressedOrTagged(node, i);
}
@ -722,7 +721,6 @@ class MachineRepresentationChecker {
switch (inferrer_->GetRepresentation(input)) {
case MachineRepresentation::kCompressed:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kCompressedSigned:
return;
default:
break;
@ -758,7 +756,6 @@ class MachineRepresentationChecker {
switch (inferrer_->GetRepresentation(input)) {
case MachineRepresentation::kCompressed:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kTagged:
case MachineRepresentation::kTaggedPointer:
case MachineRepresentation::kTaggedSigned:
@ -844,7 +841,6 @@ class MachineRepresentationChecker {
case MachineRepresentation::kWord32:
return;
case MachineRepresentation::kCompressed:
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
return;
default:
@ -989,7 +985,6 @@ class MachineRepresentationChecker {
// kTaggedPointer and the other way around, but at the moment, this
// happens in dead code.
return IsAnyTagged(actual);
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kFloat32:
case MachineRepresentation::kFloat64:

View File

@ -500,7 +500,6 @@ MachineType AtomicOpType(Operator const* op) {
V(TaggedSigned) \
V(TaggedPointer) \
V(AnyTagged) \
V(CompressedSigned) \
V(CompressedPointer) \
V(AnyCompressed)
@ -515,7 +514,6 @@ MachineType AtomicOpType(Operator const* op) {
V(kTaggedSigned) \
V(kTaggedPointer) \
V(kTagged) \
V(kCompressedSigned) \
V(kCompressedPointer) \
V(kCompressed)

View File

@ -216,7 +216,6 @@ Node* RepresentationChanger::GetRepresentationFor(
case MachineRepresentation::kNone:
return node;
case MachineRepresentation::kCompressed:
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
UNREACHABLE();
}

View File

@ -144,7 +144,6 @@ UseInfo TruncatingUseInfoFromRepresentation(MachineRepresentation rep) {
return UseInfo::Word64();
case MachineRepresentation::kBit:
return UseInfo::Bool();
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kCompressed:
case MachineRepresentation::kSimd128: