28constexpr size_t kEntrySize =
sizeof(GCInfo);
30 "GCInfoTable entries size must be power of "
55 oom_handler_(oom_handler),
59 read_only_table_end_(reinterpret_cast<uint8_t*>(
table_)) {
61 oom_handler_(
"Oilpan: GCInfoTable initial reservation.");
79 const size_t initial_limit =
81 CHECK_GT(std::numeric_limits<GCInfoIndex>::max(), initial_limit);
83 std::min(
static_cast<size_t>(
kMaxIndex), initial_limit));
89 const size_t old_committed_size =
limit_ * kEntrySize;
90 const size_t new_committed_size = new_limit * kEntrySize;
95 uint8_t* current_table_end =
96 reinterpret_cast<uint8_t*
>(
table_) + old_committed_size;
97 const size_t table_size_delta = new_committed_size - old_committed_size;
114 table_size_delta /
sizeof(uintptr_t));
121 for (
size_t i = 0;
i < len; ++
i) {
128 std::atomic<GCInfoIndex>& registered_index,
const GCInfo& info) {
135 const GCInfoIndex index = registered_index.load(std::memory_order_relaxed);
147 registered_index.store(new_index, std::memory_order_release);
FatalOutOfMemoryHandler & oom_handler_
static constexpr GCInfoIndex kInitialWantedLimit
GCInfoIndex InitialTableLimit() const
GCInfoIndex RegisterNewGCInfo(std::atomic< uint16_t > &, const GCInfo &info)
PageAllocator & allocator() const
uint8_t * read_only_table_end_
static constexpr GCInfoIndex kMinIndex
GCInfoTable(PageAllocator &page_allocator, FatalOutOfMemoryHandler &oom_handler)
PageAllocator & page_allocator_
static constexpr GCInfoIndex kMaxIndex
size_t MaxTableSize() const
v8::base::Mutex table_mutex_
GCInfoIndex current_index_
void CheckMemoryIsZeroed(uintptr_t *base, size_t len)
static void Initialize(PageAllocator &page_allocator)
static GCInfoTable * global_table_
virtual bool ReleasePages(void *address, size_t length, size_t new_length)=0
virtual size_t AllocatePageSize()=0
virtual bool SetPermissions(void *address, size_t length, Permission permissions)=0
cppgc::PageAllocator * page_allocator_
Handle< SharedFunctionInfo > info
FatalOutOfMemoryHandler & GetGlobalOOMHandler()
constexpr bool IsPowerOfTwo(T value)
SourcePositionTable *const table_
#define CHECK_GE(lhs, rhs)
#define CHECK_GT(lhs, rhs)
#define CHECK_LT(lhs, rhs)
#define CHECK_EQ(lhs, rhs)
#define DCHECK(condition)
#define DCHECK_GT(v1, v2)
constexpr T RoundUp(T x, intptr_t m)