5#ifndef V8_NUMBERS_INTEGER_LITERAL_H_
6#define V8_NUMBERS_INTEGER_LITERAL_H_
30 static_assert(std::is_integral<T>::value,
"Integral type required");
31 static_assert(
sizeof(
T) <=
sizeof(uint64_t),
32 "Types with more than 64 bits are not supported");
39 static_assert(std::is_integral<T>::value,
"Integral type required");
43 return static_cast<T
>(v);
47 std::optional<T>
TryTo()
const {
48 static_assert(std::is_integral<T>::value,
"Integral type required");
58 return other.negative_ ? 1 : -1;
69 static_assert(std::is_integral<T>::value,
"Integral type required");
83 return x.Compare(
y) == 0;
87 return x.Compare(
y) != 0;
92 return stream <<
literal.ToString();
102IntegerLiteral
operator<<(
const IntegerLiteral&
x,
const IntegerLiteral&
y);
103IntegerLiteral
operator+(
const IntegerLiteral&
x,
const IntegerLiteral&
y);
std::string ToString() const
int Compare(const IntegerLiteral &other) const
IntegerLiteral(bool negative, uint64_t absolute_value)
bool IsRepresentableAs() const
IntegerLiteral(T value, bool perform_dcheck)
std::optional< T > TryTo() const
uint64_t absolute_value() const
FunctionLiteral * literal
bool operator!=(ExternalReference lhs, ExternalReference rhs)
IntegerLiteral operator+(const IntegerLiteral &x, const IntegerLiteral &y)
std::ostream & operator<<(std::ostream &os, AtomicMemoryOrder order)
IntegerLiteral operator|(const IntegerLiteral &x, const IntegerLiteral &y)
bool operator==(ExternalReference lhs, ExternalReference rhs)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)