"trace progress of the incremental marking")
DEFINE_bool(track_gc_object_stats, false,
"track object counts and memory usage")
-DEFINE_bool(parallel_sweeping, true, "enable parallel sweeping")
-DEFINE_bool(concurrent_sweeping, false, "enable concurrent sweeping")
+DEFINE_bool(parallel_sweeping, false, "enable parallel sweeping")
+DEFINE_bool(concurrent_sweeping, true, "enable concurrent sweeping")
DEFINE_int(sweeper_threads, 0,
"number of parallel and concurrent sweeping threads")
#ifdef VERIFY_HEAP
void MarkCompactCollector::StartSweeperThreads() {
+ // TODO(hpayer): This check is just used for debugging purpose and
+ // should be removed or turned into an assert after investigating the
+ // crash in concurrent sweeping.
+ CHECK(free_list_old_pointer_space_.get()->IsEmpty());
+ CHECK(free_list_old_data_space_.get()->IsEmpty());
sweeping_pending_ = true;
for (int i = 0; i < isolate()->num_sweeper_threads(); i++) {
isolate()->sweeper_threads()[i]->StartSweeping();
int npages = evacuation_candidates_.length();
for (int i = 0; i < npages; i++) {
Page* p = evacuation_candidates_[i];
- ASSERT(p->IsEvacuationCandidate() ||
- p->IsFlagSet(Page::RESCAN_ON_EVACUATION));
+ // TODO(hpayer): This check is just used for debugging purpose and
+ // should be removed or turned into an assert after investigating the
+ // crash in concurrent sweeping.
+ CHECK(p->IsEvacuationCandidate() ||
+ p->IsFlagSet(Page::RESCAN_ON_EVACUATION));
+ CHECK_EQ(p->parallel_sweeping(), 0);
if (p->IsEvacuationCandidate()) {
// During compaction we might have to request a new page.
// Check that space still have room for that.
intptr_t MarkCompactCollector::SweepConservatively(PagedSpace* space,
FreeList* free_list,
Page* p) {
- ASSERT(!p->IsEvacuationCandidate() && !p->WasSwept());
+ // TODO(hpayer): This check is just used for debugging purpose and
+ // should be removed or turned into an assert after investigating the
+ // crash in concurrent sweeping.
+ CHECK(!p->IsEvacuationCandidate() && !p->WasSwept());
ASSERT((mode == MarkCompactCollector::SWEEP_IN_PARALLEL &&
free_list != NULL) ||
(mode == MarkCompactCollector::SWEEP_SEQUENTIALLY &&
DecreaseUnsweptFreeBytes(page);
}
+ // TODO(hpayer): This check is just used for debugging purpose and
+ // should be removed or turned into an assert after investigating the
+ // crash in concurrent sweeping.
+ CHECK(!free_list_.ContainsPageFreeListItems(page));
+
if (Page::FromAllocationTop(allocation_info_.top()) == page) {
allocation_info_.set_top(NULL);
allocation_info_.set_limit(NULL);
}
+bool FreeListCategory::ContainsPageFreeListItemsInList(Page* p) {
+ FreeListNode** n = &top_;
+ while (*n != NULL) {
+ if (Page::FromAddress((*n)->address()) == p) return true;
+ n = (*n)->next_address();
+ }
+ return false;
+}
+
+
FreeListNode* FreeListCategory::PickNodeFromList(int *node_size) {
FreeListNode* node = top_;
}
+bool FreeList::ContainsPageFreeListItems(Page* p) {
+ return huge_list_.EvictFreeListItemsInList(p) ||
+ small_list_.EvictFreeListItemsInList(p) ||
+ medium_list_.EvictFreeListItemsInList(p) ||
+ large_list_.EvictFreeListItemsInList(p);
+}
+
+
void FreeList::RepairLists(Heap* heap) {
small_list_.RepairFreeList(heap);
medium_list_.RepairFreeList(heap);
FreeListNode* PickNodeFromList(int size_in_bytes, int *node_size);
intptr_t EvictFreeListItemsInList(Page* p);
+ bool ContainsPageFreeListItemsInList(Page* p);
void RepairFreeList(Heap* heap);
Mutex* mutex() { return &mutex_; }
+ bool IsEmpty() {
+ return top_ == NULL;
+ }
+
#ifdef DEBUG
intptr_t SumFreeList();
int FreeListLength();
// 'wasted_bytes'. The size should be a non-zero multiple of the word size.
MUST_USE_RESULT HeapObject* Allocate(int size_in_bytes);
+ bool IsEmpty() {
+ return small_list_.IsEmpty() && medium_list_.IsEmpty() &&
+ large_list_.IsEmpty() && huge_list_.IsEmpty();
+ }
+
#ifdef DEBUG
void Zap();
intptr_t SumFreeLists();
void RepairLists(Heap* heap);
intptr_t EvictFreeListItems(Page* p);
+ bool ContainsPageFreeListItems(Page* p);
FreeListCategory* small_list() { return &small_list_; }
FreeListCategory* medium_list() { return &medium_list_; }