Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/heap/mark-compact.cc

Issue 1518803005: Reland of "[cctest] Add tests for aborting compaction of pages" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Filter out never allocate pages during initializing sweeping Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/heap/mark-compact.h" 5 #include "src/heap/mark-compact.h"
6 6
7 #include "src/base/atomicops.h" 7 #include "src/base/atomicops.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/base/sys-info.h" 9 #include "src/base/sys-info.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 3756 matching lines...) Expand 10 before | Expand all | Expand 10 after
3767 // Clear sweeping flags indicating that marking bits are still intact. 3767 // Clear sweeping flags indicating that marking bits are still intact.
3768 p->ClearWasSwept(); 3768 p->ClearWasSwept();
3769 3769
3770 if (p->IsFlagSet(Page::RESCAN_ON_EVACUATION) || 3770 if (p->IsFlagSet(Page::RESCAN_ON_EVACUATION) ||
3771 p->IsEvacuationCandidate()) { 3771 p->IsEvacuationCandidate()) {
3772 // Will be processed in EvacuateNewSpaceAndCandidates. 3772 // Will be processed in EvacuateNewSpaceAndCandidates.
3773 DCHECK(evacuation_candidates_.length() > 0); 3773 DCHECK(evacuation_candidates_.length() > 0);
3774 continue; 3774 continue;
3775 } 3775 }
3776 3776
3777 if (p->IsFlagSet(Page::NEVER_ALLOCATE_ON_PAGE)) {
3778 // We do not sweep pages that are marked to be ignored for allocation.
3779 p->SetWasSwept();
3780 Bitmap::Clear(p);
3781 p->ResetLiveBytes();
Hannes Payer (out of office) 2015/12/16 12:07:14 Should we really reset live bytes here? That would
Michael Lippautz 2015/12/16 12:13:14 We reset live bytes after sweeping a page. I think
Hannes Payer (out of office) 2015/12/16 12:44:00 Acknowledged.
3782 continue;
3783 }
3784
3777 // One unused page is kept, all further are released before sweeping them. 3785 // One unused page is kept, all further are released before sweeping them.
3778 if (p->LiveBytes() == 0) { 3786 if (p->LiveBytes() == 0) {
3779 if (unused_page_present) { 3787 if (unused_page_present) {
3780 if (FLAG_gc_verbose) { 3788 if (FLAG_gc_verbose) {
3781 PrintIsolate(isolate(), "sweeping: released page: %p", p); 3789 PrintIsolate(isolate(), "sweeping: released page: %p", p);
3782 } 3790 }
3783 space->ReleasePage(p); 3791 space->ReleasePage(p);
3784 continue; 3792 continue;
3785 } 3793 }
3786 unused_page_present = true; 3794 unused_page_present = true;
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
3959 MarkBit mark_bit = Marking::MarkBitFrom(host); 3967 MarkBit mark_bit = Marking::MarkBitFrom(host);
3960 if (Marking::IsBlack(mark_bit)) { 3968 if (Marking::IsBlack(mark_bit)) {
3961 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); 3969 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host);
3962 RecordRelocSlot(&rinfo, target); 3970 RecordRelocSlot(&rinfo, target);
3963 } 3971 }
3964 } 3972 }
3965 } 3973 }
3966 3974
3967 } // namespace internal 3975 } // namespace internal
3968 } // namespace v8 3976 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/spaces.h » ('j') | src/heap/spaces.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698