5#ifndef V8_ROOTS_ROOTS_INL_H_
6#define V8_ROOTS_ROOTS_INL_H_
35#if V8_ENABLE_WEBASSEMBLY
43 using type =
typename std::underlying_type<RootIndex>::type;
44 return static_cast<type
>(lhs) <
static_cast<type
>(rhs);
48 using type =
typename std::underlying_type<RootIndex>::type;
58 if (location >= last_root)
return false;
59 if (location < first_root)
return false;
60 *index =
static_cast<RootIndex>(location - first_root);
74#define ROOT_ACCESSOR(Type, name, CamelName) \
75 IndirectHandle<Type> RootsTable::name() { \
76 return IndirectHandle<Type>( \
77 handle_at(RootIndex::k##CamelName).location()); \
99 : read_only_roots_(reinterpret_cast<
Address*>(
100 isolate->roots_table().read_only_roots_begin().address())) {}
109#define ROOT_ACCESSOR(Type, name, CamelName) \
110 Tagged<Type> ReadOnlyRoots::name() const { \
111 return unchecked_##name(); \
113 Tagged<Type> ReadOnlyRoots::unchecked_##name() const { \
114 return UncheckedCast<Type>(object_at(RootIndex::k##CamelName)); \
148#if V8_STATIC_ROOTS_BOOL
151 StaticReadOnlyRootsPointerTable[
static_cast<int>(root_index)]);
153 size_t index =
static_cast<size_t>(root_index);
158 root_index == RootIndex::kFreeSpaceMap);
164 size_t index =
static_cast<size_t>(root_index);
static IsolateGroup * current()
ReadOnlyHeap * shared_read_only_heap() const
static V8_INLINE PageMetadata * FromAddress(Address addr)
bool roots_init_complete() const
Address read_only_roots_[kEntriesCount]
V8_INLINE Address address_at(RootIndex root_index) const
V8_INLINE Address first_name_for_protector() const
V8_INLINE Tagged< Object > object_at(RootIndex root_index) const
Address * read_only_roots_
static constexpr size_t kEntriesCount
V8_INLINE void VerifyNameForProtectorsPages() const
V8_INLINE Tagged< Boolean > boolean_value(bool value) const
V8_INLINE Address last_name_for_protector() const
V8_INLINE bool IsNameForProtector(Tagged< HeapObject > object) const
V8_INLINE ReadOnlyRoots(Heap *heap)
V8_INLINE bool is_initialized(RootIndex root_index) const
Address roots_[kEntriesCount]
V8_INLINE IndirectHandle< Object > handle_at(RootIndex root_index)
static constexpr size_t kEntriesCount
bool IsRootHandleLocation(Address *handle_location, RootIndex *index) const
bool IsRootHandle(IndirectHandle< T > handle, RootIndex *index) const
static V8_INLINE Address DecompressTagged(TOnHeapAddress on_heap_addr, Tagged_t raw_value)
V8_CONST static V8_INLINE Address base()
#define ROOT_ACCESSOR(Type, name, CamelName)
constexpr bool IsInRange(T value, U lower_limit, U higher_limit)
V8_INLINE IndirectHandle< T > handle(Tagged< T > object, Isolate *isolate)
ReadOnlyRoots GetReadOnlyRoots()
Tagged(T object) -> Tagged< T >
V8_INLINE constexpr bool operator<(Builtin a, Builtin b)
Handle< T > IndirectHandle
V8_INLINE Builtin operator++(Builtin &builtin)
static constexpr Address kNullAddress
#define READ_ONLY_ROOT_LIST(V)
#define DCHECK_IMPLIES(v1, v2)
#define CHECK_EQ(lhs, rhs)
#define DCHECK(condition)
#define DCHECK_LT(v1, v2)