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

Adding CompressedXXX representations

Bug: v8:8977
Change-Id: I3bf6606d9db2369f5d82c71c5f58f6cf0c34bc0d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1520712
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Auto-Submit: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60220}
parent 10e6da53
......@@ -476,7 +476,10 @@ void InstructionSelector::VisitLoad(Node* node) {
case MachineRepresentation::kSimd128:
opcode = kArmVld1S128;
break;
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE();
return;
......@@ -569,7 +572,10 @@ void InstructionSelector::VisitStore(Node* node) {
case MachineRepresentation::kSimd128:
opcode = kArmVst1S128;
break;
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE();
return;
......
......@@ -633,7 +633,18 @@ void InstructionSelector::VisitLoad(Node* node) {
opcode = kArm64LdrDecompressAnyTagged;
immediate_mode = kLoadStoreImm32;
break;
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kCompressed:
opcode = kArm64LdrW;
immediate_mode = kLoadStoreImm32;
break;
#else
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed:
UNREACHABLE();
return;
case MachineRepresentation::kTaggedSigned: // Fall through.
case MachineRepresentation::kTaggedPointer: // Fall through.
case MachineRepresentation::kTagged: // Fall through.
......@@ -748,7 +759,18 @@ void InstructionSelector::VisitStore(Node* node) {
opcode = kArm64StrCompressTagged;
immediate_mode = kLoadStoreImm32;
break;
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kCompressed:
opcode = kArm64StrW;
immediate_mode = kLoadStoreImm32;
break;
#else
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed:
UNREACHABLE();
return;
case MachineRepresentation::kTaggedSigned: // Fall through.
case MachineRepresentation::kTaggedPointer: // Fall through.
case MachineRepresentation::kTagged: // Fall through.
......
......@@ -304,7 +304,10 @@ void InstructionSelector::VisitLoad(Node* node) {
case MachineRepresentation::kSimd128:
opcode = kIA32Movdqu;
break;
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE();
return;
......@@ -395,7 +398,10 @@ void InstructionSelector::VisitStore(Node* node) {
case MachineRepresentation::kSimd128:
opcode = kIA32Movdqu;
break;
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE();
return;
......
......@@ -335,6 +335,9 @@ class OperandGenerator {
case MachineRepresentation::kTagged:
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:
return Constant(static_cast<double>(0));
......
......@@ -231,6 +231,15 @@ 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;
case MachineRepresentation::kCompressed:
os << "|c";
break;
}
return os << "]";
}
......@@ -892,6 +901,9 @@ 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;
case MachineRepresentation::kNone:
break;
......
......@@ -477,6 +477,9 @@ class LocationOperand : public InstructionOperand {
case MachineRepresentation::kTaggedSigned:
case MachineRepresentation::kTaggedPointer:
case MachineRepresentation::kTagged:
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kCompressed:
return true;
case MachineRepresentation::kBit:
case MachineRepresentation::kWord8:
......
......@@ -309,7 +309,10 @@ void InstructionSelector::VisitLoad(Node* node) {
case MachineRepresentation::kSimd128:
opcode = kMipsMsaLd;
break;
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE();
return;
......@@ -402,7 +405,10 @@ void InstructionSelector::VisitStore(Node* node) {
case MachineRepresentation::kSimd128:
opcode = kMipsMsaSt;
break;
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE();
return;
......@@ -1348,7 +1354,10 @@ void InstructionSelector::VisitUnalignedLoad(Node* node) {
case MachineRepresentation::kSimd128:
opcode = kMipsMsaLd;
break;
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE();
return;
......@@ -1400,7 +1409,10 @@ void InstructionSelector::VisitUnalignedStore(Node* node) {
case MachineRepresentation::kSimd128:
opcode = kMipsMsaSt;
break;
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE();
return;
......
......@@ -390,6 +390,9 @@ void InstructionSelector::VisitLoad(Node* node) {
case MachineRepresentation::kSimd128:
opcode = kMips64MsaLd;
break;
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE();
return;
......@@ -475,6 +478,9 @@ void InstructionSelector::VisitStore(Node* node) {
case MachineRepresentation::kSimd128:
opcode = kMips64MsaSt;
break;
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE();
return;
......@@ -1696,6 +1702,9 @@ void InstructionSelector::VisitUnalignedLoad(Node* node) {
case MachineRepresentation::kSimd128:
opcode = kMips64MsaLd;
break;
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE();
return;
......@@ -1748,6 +1757,9 @@ void InstructionSelector::VisitUnalignedStore(Node* node) {
case MachineRepresentation::kSimd128:
opcode = kMips64MsaSt;
break;
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE();
return;
......
......@@ -209,6 +209,9 @@ void InstructionSelector::VisitLoad(Node* node) {
opcode = kPPC_LoadWord64;
mode = kInt16Imm_4ByteAligned;
break;
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kSimd128: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE();
......@@ -343,6 +346,9 @@ void InstructionSelector::VisitStore(Node* node) {
#else
case MachineRepresentation::kWord64: // Fall through.
#endif
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kSimd128: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE();
......
......@@ -75,6 +75,9 @@ int GetByteWidth(MachineRepresentation rep) {
case MachineRepresentation::kTaggedSigned:
case MachineRepresentation::kTaggedPointer:
case MachineRepresentation::kTagged:
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kCompressed:
return kTaggedSize;
case MachineRepresentation::kWord64:
case MachineRepresentation::kFloat64:
......
......@@ -315,6 +315,9 @@ ArchOpcode SelectLoadOpcode(Node* node) {
#else
case MachineRepresentation::kWord64: // Fall through.
#endif
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kSimd128: // Fall through.
case MachineRepresentation::kNone:
default:
......@@ -775,9 +778,12 @@ static void VisitGeneralStore(
opcode = kS390_StoreWord16;
break;
#if !V8_TARGET_ARCH_S390X
case MachineRepresentation::kTaggedSigned: // Fall through.
case MachineRepresentation::kTaggedPointer: // Fall through.
case MachineRepresentation::kTagged: // Fall through.
case MachineRepresentation::kTaggedSigned: // Fall through.
case MachineRepresentation::kTaggedPointer: // Fall through.
case MachineRepresentation::kTagged: // Fall through.
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
#endif
case MachineRepresentation::kWord32:
opcode = kS390_StoreWord32;
......@@ -787,9 +793,12 @@ static void VisitGeneralStore(
}
break;
#if V8_TARGET_ARCH_S390X
case MachineRepresentation::kTaggedSigned: // Fall through.
case MachineRepresentation::kTaggedPointer: // Fall through.
case MachineRepresentation::kTagged: // Fall through.
case MachineRepresentation::kTaggedSigned: // Fall through.
case MachineRepresentation::kTaggedPointer: // Fall through.
case MachineRepresentation::kTagged: // Fall through.
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kWord64:
opcode = kS390_StoreWord64;
if (m.IsWord64ReverseBytes()) {
......
......@@ -242,15 +242,30 @@ ArchOpcode GetLoadOpcode(LoadRepresentation load_rep) {
break;
#ifdef V8_COMPRESS_POINTERS
case MachineRepresentation::kTaggedSigned:
return kX64MovqDecompressTaggedSigned;
opcode = kX64MovqDecompressTaggedSigned;
break;
case MachineRepresentation::kTaggedPointer:
return kX64MovqDecompressTaggedPointer;
opcode = kX64MovqDecompressTaggedPointer;
break;
case MachineRepresentation::kTagged:
return kX64MovqDecompressAnyTagged;
opcode = kX64MovqDecompressAnyTagged;
break;
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed:
opcode = kX64Movl;
break;
#else
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed:
UNREACHABLE();
break;
case MachineRepresentation::kTaggedSigned: // Fall through.
case MachineRepresentation::kTaggedPointer: // Fall through.
case MachineRepresentation::kTagged: // Fall through.
case MachineRepresentation::kTagged:
opcode = kX64Movq;
break;
#endif
case MachineRepresentation::kWord64:
opcode = kX64Movq;
......@@ -283,11 +298,25 @@ ArchOpcode GetStoreOpcode(StoreRepresentation store_rep) {
case MachineRepresentation::kWord32:
return kX64Movl;
break;
#ifdef V8_COMPRESS_POINTERS
case MachineRepresentation::kTaggedSigned: // Fall through.
case MachineRepresentation::kTaggedPointer: // Fall through.
case MachineRepresentation::kTagged: // Fall through.
#ifdef V8_COMPRESS_POINTERS
case MachineRepresentation::kTagged:
return kX64MovqCompressTagged;
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed:
return kX64Movl;
#else
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed:
UNREACHABLE();
case MachineRepresentation::kTaggedSigned: // Fall through.
case MachineRepresentation::kTaggedPointer: // Fall through.
case MachineRepresentation::kTagged:
return kX64Movq;
break;
#endif
case MachineRepresentation::kWord64:
return kX64Movq;
......@@ -567,6 +596,8 @@ 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;
default:
......
......@@ -2449,6 +2449,10 @@ JSNativeContextSpecialization::BuildPropertyStore(
case MachineRepresentation::kWord64:
case MachineRepresentation::kFloat32:
case MachineRepresentation::kSimd128:
// TODO(solanes): Create the code for the compressed values
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kCompressed:
UNREACHABLE();
break;
}
......
......@@ -890,6 +890,10 @@ Reduction LoadElimination::ReduceLoadElement(Node* node) {
switch (access.machine_type.representation()) {
case MachineRepresentation::kNone:
case MachineRepresentation::kBit:
// TODO(solanes): Create the code for the compressed values
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kCompressed:
UNREACHABLE();
break;
case MachineRepresentation::kWord8:
......@@ -944,6 +948,10 @@ Reduction LoadElimination::ReduceStoreElement(Node* node) {
switch (access.machine_type.representation()) {
case MachineRepresentation::kNone:
case MachineRepresentation::kBit:
// TODO(solanes): Create the code for the compressed values
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kCompressed:
UNREACHABLE();
break;
case MachineRepresentation::kWord8:
......@@ -1262,6 +1270,9 @@ int LoadElimination::FieldIndexOf(FieldAccess const& access) {
case MachineRepresentation::kTaggedSigned:
case MachineRepresentation::kTaggedPointer:
case MachineRepresentation::kTagged:
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kCompressed:
// TODO(bmeurer): Check that we never do overlapping load/stores of
// individual parts of Float64 values.
break;
......
......@@ -885,8 +885,14 @@ class MachineRepresentationChecker {
return (actual == MachineRepresentation::kTagged ||
actual == MachineRepresentation::kTaggedSigned ||
actual == MachineRepresentation::kTaggedPointer);
case MachineRepresentation::kCompressed:
return (actual == MachineRepresentation::kCompressed ||
actual == MachineRepresentation::kCompressedSigned ||
actual == MachineRepresentation::kCompressedPointer);
case MachineRepresentation::kTaggedSigned:
case MachineRepresentation::kTaggedPointer:
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kFloat32:
case MachineRepresentation::kFloat64:
case MachineRepresentation::kSimd128:
......
......@@ -380,7 +380,10 @@ MachineType AtomicOpType(Operator const* op) {
V(Pointer) \
V(TaggedSigned) \
V(TaggedPointer) \
V(AnyTagged)
V(AnyTagged) \
V(CompressedSigned) \
V(CompressedPointer) \
V(AnyCompressed)
#define MACHINE_REPRESENTATION_LIST(V) \
V(kFloat32) \
......@@ -392,7 +395,10 @@ MachineType AtomicOpType(Operator const* op) {
V(kWord64) \
V(kTaggedSigned) \
V(kTaggedPointer) \
V(kTagged)
V(kTagged) \
V(kCompressedSigned) \
V(kCompressedPointer) \
V(kCompressed)
#define ATOMIC_U32_TYPE_LIST(V) \
V(Uint8) \
......
......@@ -196,6 +196,11 @@ Node* RepresentationChanger::GetRepresentationFor(
use_info.type_check() == TypeCheckKind::kSigned64);
return GetWord64RepresentationFor(node, output_rep, output_type, use_node,
use_info);
// TODO(solanes): Create the code for the compressed values
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kCompressed:
UNREACHABLE();
case MachineRepresentation::kSimd128:
case MachineRepresentation::kNone:
return node;
......
......@@ -144,6 +144,10 @@ UseInfo TruncatingUseInfoFromRepresentation(MachineRepresentation rep) {
return UseInfo::Word64();
case MachineRepresentation::kBit:
return UseInfo::Bool();
// TODO(solanes): Create the code for the compressed values
case MachineRepresentation::kCompressedSigned:
case MachineRepresentation::kCompressedPointer:
case MachineRepresentation::kCompressed:
case MachineRepresentation::kSimd128:
case MachineRepresentation::kNone:
break;
......
......@@ -11,10 +11,12 @@ namespace internal {
bool IsSubtype(MachineRepresentation rep1, MachineRepresentation rep2) {
if (rep1 == rep2) return true;
switch (rep1) {
case MachineRepresentation::kTaggedSigned:
case MachineRepresentation::kTaggedSigned: // Fall through.
case MachineRepresentation::kTaggedPointer:
return rep2 == MachineRepresentation::kTagged;
case MachineRepresentation ::kTaggedPointer:
return rep2 == MachineRepresentation ::kTagged;
case MachineRepresentation::kCompressedSigned: // Fall through.
case MachineRepresentation::kCompressedPointer:
return rep2 == MachineRepresentation::kCompressed;
default:
return false;
}
......@@ -50,6 +52,12 @@ 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:
return "kRepCompressed";
}
UNREACHABLE();
}
......
......@@ -23,6 +23,9 @@ enum class MachineRepresentation : uint8_t {
kTaggedSigned,
kTaggedPointer,
kTagged,
kCompressedSigned,
kCompressedPointer,
kCompressed,
// FP representations must be last, and in order of increasing size.
kFloat32,
kFloat64,
......@@ -100,6 +103,17 @@ class MachineType {
constexpr bool IsTaggedPointer() const {
return representation() == MachineRepresentation::kTaggedPointer;
}
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;
}
constexpr static MachineRepresentation PointerRepresentation() {
return (kSystemPointerSize == 4) ? MachineRepresentation::kWord32
: MachineRepresentation::kWord64;
......@@ -162,12 +176,28 @@ 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);
}
constexpr static MachineType AnyCompressed() {
return MachineType(MachineRepresentation::kCompressed,
MachineSemantic::kAny);
}
constexpr static MachineType Bool() {
return MachineType(MachineRepresentation::kBit, MachineSemantic::kBool);
}
constexpr static MachineType TaggedBool() {
return MachineType(MachineRepresentation::kTagged, MachineSemantic::kBool);
}
constexpr static MachineType CompressedBool() {
return MachineType(MachineRepresentation::kCompressed,
MachineSemantic::kBool);
}
constexpr static MachineType None() {
return MachineType(MachineRepresentation::kNone, MachineSemantic::kNone);
}
......@@ -197,6 +227,10 @@ class MachineType {
constexpr static MachineType RepTagged() {
return MachineType(MachineRepresentation::kTagged, MachineSemantic::kNone);
}
constexpr static MachineType RepCompressed() {
return MachineType(MachineRepresentation::kCompressed,
MachineSemantic::kNone);
}
constexpr static MachineType RepBit() {
return MachineType(MachineRepresentation::kBit, MachineSemantic::kNone);
}
......@@ -228,6 +262,12 @@ class MachineType {
return MachineType::TaggedSigned();
case MachineRepresentation::kTaggedPointer:
return MachineType::TaggedPointer();
case MachineRepresentation::kCompressed:
return MachineType::AnyCompressed();
case MachineRepresentation::kCompressedPointer:
return MachineType::CompressedPointer();
case MachineRepresentation::kCompressedSigned:
return MachineType::CompressedSigned();
default:
UNREACHABLE();
}
......@@ -274,6 +314,21 @@ inline bool IsAnyTagged(MachineRepresentation rep) {
return CanBeTaggedPointer(rep) || rep == MachineRepresentation::kTaggedSigned;
}
inline bool CanBeCompressedPointer(MachineRepresentation rep) {
return rep == MachineRepresentation::kCompressed ||
rep == MachineRepresentation::kCompressedPointer;
}
inline bool CanBeCompressedSigned(MachineRepresentation rep) {
return rep == MachineRepresentation::kCompressed ||
rep == MachineRepresentation::kCompressedSigned;
}
inline bool IsAnyCompressed(MachineRepresentation rep) {
return CanBeCompressedPointer(rep) ||
rep == MachineRepresentation::kCompressedSigned;
}
// Gets the log2 of the element size in bytes of the machine type.
V8_EXPORT_PRIVATE inline int ElementSizeLog2Of(MachineRepresentation rep) {
switch (rep) {
......@@ -293,6 +348,9 @@ 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;
default:
break;
......
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