5#ifndef V8_CODEGEN_MACHINE_TYPE_H_
6#define V8_CODEGEN_MACHINE_TYPE_H_
66#define ASSERT_CONSECUTIVE(rep1, rep2) \
67 static_assert(static_cast<uint8_t>(MachineRepresentation::k##rep1) + 1 == \
68 static_cast<uint8_t>(MachineRepresentation::k##rep2), \
69 #rep1 " and " #rep2 " must be consecutive.");
78#undef ASSERT_CONSECUTIVE
82 "FP and SIMD representations must be last.");
86 "Bit masks of MachineRepresentation should fit in an int");
124 return !(*
this == other);
281 bool isSigned =
true) {
325 switch (type.GetType()) {
341 "CTypeInfo::Type::kAny is assumed to be of size 64 bits.");
372 return static_cast<size_t>(rep);
376 return static_cast<size_t>(type.representation()) +
377 static_cast<size_t>(type.semantic()) * 16;
497 return std::numeric_limits<uint8_t>::max();
499 return std::numeric_limits<uint16_t>::max();
501 return std::numeric_limits<uint32_t>::max();
503 return std::numeric_limits<uint64_t>::max();
518 return 1 <<
static_cast<int>(rep);
static constexpr MachineType Simd256()
constexpr bool IsUnsigned() const
static MachineType TypeForRepresentation(const MachineRepresentation &rep, bool isSigned=true)
constexpr bool IsTagged() const
constexpr MachineSemantic semantic() const
static constexpr MachineType MapInHeader()
static constexpr MachineType Float16()
constexpr MachineType(MachineRepresentation representation, MachineSemantic semantic)
constexpr bool IsSigned() const
static constexpr MachineType Float64()
static constexpr MachineType Pointer()
static constexpr MachineType Uint8()
static constexpr MachineType SignedBigInt64()
MachineSemantic semantic_
constexpr MachineRepresentation representation() const
constexpr bool IsIndirectPointer() const
constexpr bool LessThanOrEqualPointerSize() const
constexpr bool IsNone() const
constexpr bool IsCompressedPointer() const
static constexpr MachineType Int32()
static constexpr MachineType Simd128()
constexpr bool operator!=(MachineType other) const
static constexpr MachineType AnyTagged()
constexpr bool IsTaggedPointer() const
static constexpr MachineType Uint64()
static constexpr MachineType Uint32()
static constexpr MachineType AnyCompressed()
static MachineType TypeForCType(const CTypeInfo &type)
static constexpr MachineType SandboxedPointer()
constexpr uint8_t MemSize() const
static constexpr MachineType TaggedSigned()
MachineRepresentation representation_
static constexpr MachineType IndirectPointer()
constexpr bool operator==(MachineType other) const
constexpr bool IsMapWord() const
static constexpr MachineType UnsignedBigInt64()
static constexpr MachineType Uint16()
static constexpr MachineType Int16()
constexpr bool IsTaggedSigned() const
static constexpr MachineType Float32()
constexpr bool IsCompressed() const
static constexpr MachineType Bool()
static constexpr MachineType Int64()
static constexpr MachineType None()
static constexpr MachineType HoleyFloat64()
static constexpr MachineType TaggedPointer()
static constexpr MachineType ProtectedPointer()
static constexpr MachineType UintPtr()
static constexpr MachineType Int8()
static constexpr MachineRepresentation PointerRepresentation()
static constexpr MachineType IntPtr()
static constexpr MachineType CompressedPointer()
#define ASSERT_CONSECUTIVE(rep1, rep2)
WordWithBits< 64 > Word64
FloatWithBits< 32 > Float32
WordWithBits< 32 > Word32
WordWithBits< 128 > Simd128
WordWithBits< 256 > Simd256
FloatWithBits< 64 > Float64
constexpr int ElementSizeInBits(MachineRepresentation rep)
constexpr int kMaximumReprSizeInBytes
constexpr int kBitsPerByte
constexpr bool CanBeTaggedOrCompressedOrIndirectPointer(MachineRepresentation rep)
V8_EXPORT_PRIVATE constexpr int ElementSizeInPointers(MachineRepresentation rep)
size_t hash_value(AtomicMemoryOrder order)
constexpr bool CanBeTaggedOrCompressedPointer(MachineRepresentation rep)
V8_EXPORT_PRIVATE constexpr int RepresentationBit(MachineRepresentation rep)
constexpr int kSystemPointerSizeLog2
constexpr bool IsAnyTagged(MachineRepresentation rep)
std::ostream & operator<<(std::ostream &os, AtomicMemoryOrder order)
constexpr bool IsAnyCompressed(MachineRepresentation rep)
constexpr int kSystemPointerSize
constexpr int kMaximumReprSizeLog2
constexpr int kTaggedSizeLog2
constexpr bool IsFloatingPoint(MachineRepresentation rep)
constexpr uint64_t MaxUnsignedValue(MachineRepresentation rep)
constexpr bool CanBeTaggedPointer(MachineRepresentation rep)
const char * MachineReprToString(MachineRepresentation rep)
constexpr bool CanBeIndirectPointer(MachineRepresentation rep)
bool IsSubtype(MachineRepresentation rep1, MachineRepresentation rep2)
V8_EXPORT_PRIVATE constexpr int ElementSizeLog2Of(MachineRepresentation)
constexpr bool IsSimd128(MachineRepresentation rep)
constexpr bool CanBeTaggedSigned(MachineRepresentation rep)
V8_EXPORT_PRIVATE constexpr int ElementSizeInBytes(MachineRepresentation)
constexpr bool CanBeCompressedPointer(MachineRepresentation rep)
constexpr bool IsIntegral(MachineRepresentation rep)
#define V8_EXPORT_PRIVATE