5#ifndef V8_HEAP_FACTORY_BASE_INL_H_
6#define V8_HEAP_FACTORY_BASE_INL_H_
25#define RO_ROOT_ACCESSOR(Type, name, CamelName) \
26 template <typename Impl> \
27 Handle<Type> FactoryBase<Impl>::name() { \
28 return isolate()->roots_table().name(); \
33#define MUTABLE_ROOT_ACCESSOR(Type, name, CamelName) \
34 template <typename Impl> \
35 Handle<Type> FactoryBase<Impl>::name() { \
36 return handle(isolate()->heap()->name(), isolate()); \
41template <
typename Impl>
47template <
typename Impl>
48template <AllocationType allocation>
55 return NewHeapNumber<allocation>(value);
58template <
typename Impl>
59template <AllocationType allocation>
63 return NewHeapNumber<allocation>(
FastI2D(value));
66template <
typename Impl>
67template <AllocationType allocation>
69 int32_t int32v =
static_cast<int32_t
>(
value);
73 return NewHeapNumber<allocation>(
FastUI2D(value));
76template <
typename Impl>
77template <AllocationType allocation>
85 return NewHeapNumber<allocation>(
static_cast<double>(value));
88template <
typename Impl>
89template <AllocationType allocation>
91 if (value <= std::numeric_limits<int32_t>::max() &&
92 value >= std::numeric_limits<int32_t>::min() &&
96 return NewHeapNumber<allocation>(
static_cast<double>(value));
99template <
typename Impl>
100template <AllocationType allocation>
103 heap_number->set_value(value);
107template <
typename Impl>
108template <AllocationType allocation>
111 heap_number->set_value_as_bits(bits);
115template <
typename Impl>
116template <AllocationType allocation>
121template <
typename Impl>
122template <AllocationType allocation>
125 heap_number->set_value_as_bits(
130template <
typename Impl>
131template <
typename StructType>
137 if constexpr (std::is_base_of_v<StructLayout, StructType>) {
138 size =
sizeof(StructType);
140 size = StructType::kSize;
145template <
typename Impl>
154 MemsetTagged(str->RawField(Struct::kHeaderSize), undefined, length);
Handle< Boolean > ToBoolean(bool value)
Handle< Number > NewNumberFromInt(int32_t value)
DirectHandle< Number > NewNumberFromSize(size_t value)
Handle< HeapNumber > NewHeapNumberFromBits(uint64_t bits)
Handle< HeapNumber > NewHeapInt32(int32_t value)
Handle< Number > NewNumberFromUint(uint32_t value)
Tagged< StructType > NewStructInternal(InstanceType type, AllocationType allocation)
Handle< Number > NewNumber(double value)
Handle< HeapNumber > NewHeapNumberWithHoleNaN()
DirectHandle< Number > NewNumberFromInt64(int64_t value)
Handle< HeapNumber > NewHeapNumber()
static Tagged< Map > GetMapFor(ReadOnlyRoots roots, InstanceType type)
static constexpr Tagged< Smi > FromInt(int value)
static constexpr Tagged< Smi > FromIntptr(intptr_t value)
static bool constexpr IsValid(T value)
static constexpr int kMaxValue
#define RO_ROOT_ACCESSOR(Type, name, CamelName)
#define MUTABLE_ROOT_ACCESSOR(Type, name, CamelName)
ZoneVector< RpoNumber > & result
V8_INLINE IndirectHandle< T > handle(Tagged< T > object, Isolate *isolate)
bool DoubleToSmiInteger(double value, int *smi_int_value)
constexpr uint64_t kHoleNanInt64
void MemsetTagged(Tagged_t *start, Tagged< MaybeObject > value, size_t counter)
V8_INLINE DirectHandle< T > direct_handle(Tagged< T > object, Isolate *isolate)
constexpr int kTaggedSizeLog2
constexpr uint32_t kHoleNanUpper32
double FastUI2D(unsigned x)
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
#define MUTABLE_ROOT_LIST(V)
#define READ_ONLY_ROOT_LIST(V)
#define DCHECK_EQ(v1, v2)