67 kCodePointerTableReservationSize> {
77 static constexpr Handle kInvalidHandle = -1;
78#ifdef V8_ENABLE_SANDBOX
79 static constexpr int kOffsetOfSignatureHash =
83#ifdef V8_TARGET_ARCH_64_BIT
86 static constexpr size_t kMaxWasmCodePointers = kMaxCapacity;
99 uint64_t signature_hash)
const;
101 inline Address GetEntrypointWithoutSignatureCheck(
108 uint64_t signature_hash);
109 inline void SetEntrypointAndSignature(
WasmCodePointer index, Address value,
110 uint64_t signature_hash);
111 inline void SetEntrypointWithWriteScope(
WasmCodePointer index, Address value,
112 uint64_t signature_hash,
117 uint64_t signature_hash);
125 void SweepSegments(
size_t threshold = 2 * kEntriesPerSegment);
135 friend class ::v8::internal::ExternalReference;
139 static constexpr FreelistHead kRetryMarker = FreelistHead(0xffffffff, 0);
141 return freelist.length() == kRetryMarker.length() &&
142 freelist.next() == kRetryMarker.next();
146 V8_INLINE FreelistHead ReadFreelistHead();
152 V8_INLINE FreelistHead LinkFreelist(FreelistHead new_freelist,
153 uint32_t last_element);
158 FreelistHead VectorToFreelist(std::vector<uint32_t>
entries);
165 V8_INLINE bool TryAllocateFromFreelist(uint32_t* index);
170 AllocateEntryFromFreelistNonAtomic(FreelistHead* freelist_head);
173 void FreeNativeFunctionHandles();
175 std::atomic<FreelistHead> freelist_head_ = FreelistHead();
183 friend class WasmCodePointerTableTest;
void UpdateCodePointerEntry(Address entrypoint, uint64_t signature_hash)
void MakeCodePointerEntry(Address entrypoint, uint64_t signature_hash)
std::atomic< Address > entrypoint_
Address GetEntrypoint(uint64_t signature_hash) const
uint32_t GetNextFreelistEntryIndex() const
static constexpr bool IsWriteProtected
Address GetEntrypointWithoutSignatureCheck() const
void MakeFreelistEntry(uint32_t next_entry_index)