Lines Matching refs:value
19 // The ptr_ value has the following format: [31 bit signed int] 0
32 // Returns the integer value.
33 inline int value() const { return Internals::SmiValue(ptr()); }
35 if (value() <= 0) return Smi::FromInt(0);
36 return Smi::FromInt(static_cast<uint32_t>(value()));
41 return Smi::cast(object).value();
44 // Convert a value to a Smi object.
45 static inline constexpr Smi FromInt(int value) {
46 DCHECK(Smi::IsValid(value));
47 return Smi(Internals::IntToSmi(value));
50 static inline Smi FromIntptr(intptr_t value) {
51 DCHECK(Smi::IsValid(value));
53 return Smi((static_cast<Address>(value) << smi_shift_bits) | kSmiTag);
56 // Given {value} in [0, 2^31-1], force it into Smi range by changing at most
58 static inline Smi From31BitPattern(int value) {
59 return Smi::FromInt((value << (32 - kSmiValueSize)) >>
64 typename = typename std::enable_if<std::is_enum<E>::value>::type>
65 static inline Smi FromEnum(E value) {
67 return FromInt(static_cast<int>(value));
70 // Returns whether value can be represented in a Smi.
71 static inline bool constexpr IsValid(intptr_t value) {
72 DCHECK_EQ(Internals::IsValidSmi(value),
73 value >= kMinValue && value <= kMaxValue);
74 return Internals::IsValidSmi(value);
99 // Smi value for filling in not-yet initialized tagged field values with a
100 // valid tagged pointer. A field value equal to this doesn't necessarily
102 // definitely equal this value.
104 // This _has_ to be kNullAddress, so that an uninitialized field value read as
109 // uninitialized pointer value.