21 ASSERT(!page->is_executable());
27 while (current <
end) {
30 uword tags = raw_obj->
untag()->tags_.
load(std::memory_order_relaxed);
37 uword free_end = current + obj_size;
38 while (free_end <
end) {
40 tags = next_obj->
untag()->tags_.
load(std::memory_order_relaxed);
48 obj_size = free_end - current;
50 memset(
reinterpret_cast<void*
>(current),
Heap::kZapByte, obj_size);
64 ASSERT(!page->is_large() || page->is_executable());
68 intptr_t used_in_bytes = 0;
70 bool is_executable = page->is_executable();
74 const bool dontneed_on_sweep = FLAG_dontneed_on_sweep;
77 while (current <
end) {
83 uword tags = raw_obj->
untag()->tags_.
load(std::memory_order_acquire);
88 used_in_bytes += obj_size;
92 uword free_end = current + obj_size;
93 while (free_end <
end) {
95 tags = next_obj->
untag()->tags_.
load(std::memory_order_acquire);
104 if ((current ==
start) && (free_end ==
end)) {
107 obj_size = free_end - current;
109 uword cursor = current;
111 while (cursor <
end) {
115 }
else if (
UNLIKELY(dontneed_on_sweep)) {
119 if (
UNLIKELY(page_aligned_start < page_aligned_end)) {
121 page_aligned_end - page_aligned_start);
125 memset(
reinterpret_cast<void*
>(current),
Heap::kZapByte, obj_size);
133 ASSERT(used_in_bytes != 0);
138 ASSERT(!page->is_image());
139 ASSERT(page->is_large() && !page->is_executable());
141 intptr_t words_to_end = 0;
154 while (current <
end) {
158 memset(
reinterpret_cast<void*
>(current),
Heap::kZapByte, obj_size);
168 : isolate_group_(isolate_group) {
169 ASSERT(isolate_group !=
nullptr);
186 old_space->SweepLarge();
195 old_space->Sweep(
false);
#define DEBUG_ASSERT(cond)
T load(std::memory_order order) const
ConcurrentSweeperTask(IsolateGroup *isolate_group)
static ThreadPool * thread_pool()
static FreeListElement * AsElementNew(uword addr, intptr_t size)
static constexpr intptr_t kLargeHeaderSize
void FreeLocked(uword addr, intptr_t size)
bool SweepPage(Page *page, FreeList *freelist)
static void SweepConcurrent(IsolateGroup *isolate_group)
intptr_t SweepNewPage(Page *page)
intptr_t SweepLargePage(Page *page)
static constexpr uint8_t kZapByte
bool IsOwnedByCurrentThread() const
UntaggedObject * untag() const
void set_tasks(intptr_t val)
void set_phase(Phase val)
Monitor * tasks_lock() const
static Page * Of(ObjectPtr obj)
bool Run(Args &&... args)
static Thread * Current()
static void ExitIsolateGroupAsNonMutator()
static bool EnterIsolateGroupAsNonMutator(IsolateGroup *isolate_group, TaskKind kind)
bool BypassSafepoints() const
static ObjectPtr FromAddr(uword addr)
static bool IsMarked(uword tags)
static uword ToAddr(const UntaggedObject *raw_obj)
intptr_t HeapSize() const
void ClearMarkBitUnsynchronized()
static constexpr T RoundUp(T x, uintptr_t alignment, uintptr_t offset=0)
static constexpr T RoundDown(T x, intptr_t alignment)
static intptr_t PageSize()
static void DontNeed(void *address, intptr_t size)
constexpr intptr_t kWordSizeLog2
constexpr uword kBreakInstructionFiller
bool IsAllocatableInNewSpace(intptr_t size)
constexpr intptr_t kWordSize
bool IsAllocatableViaFreeLists(intptr_t size)
#define TIMELINE_FUNCTION_GC_DURATION(thread, name)