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);
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)) {
105 page->set_live_bytes(0);
108 obj_size = free_end - current;
110 uword cursor = current;
112 while (cursor <
end) {
116 }
else if (
UNLIKELY(dontneed_on_sweep)) {
120 if (
UNLIKELY(page_aligned_start < page_aligned_end)) {
122 page_aligned_end - page_aligned_start);
126 memset(
reinterpret_cast<void*
>(current),
Heap::kZapByte, obj_size);
134 ASSERT(used_in_bytes != 0);
135 page->set_live_bytes(used_in_bytes);
143 intptr_t words_to_end = 0;
156 while (current <
end) {
160 memset(
reinterpret_cast<void*
>(current),
Heap::kZapByte, obj_size);
170 : isolate_group_(isolate_group) {
171 ASSERT(isolate_group !=
nullptr);
188 old_space->SweepLarge();
197 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)