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

Unified Diff: src/spaces.cc

Issue 256743004: Don't unlink evacuation candidates before sweeping, move them to the end of their list of pages. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/spaces.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces.cc
diff --git a/src/spaces.cc b/src/spaces.cc
index 7cbe9c5ca6ffb133f2d5b528f9f13998922b284f..c4ebabb32fdc45ff89e6ebe0ff2532e30212041b 100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -559,10 +559,6 @@ void MemoryChunk::InsertAfter(MemoryChunk* other) {
void MemoryChunk::Unlink() {
- if (!InNewSpace() && IsFlagSet(SCAN_ON_SCAVENGE)) {
- heap_->decrement_scan_on_scavenge_pages();
- ClearFlag(SCAN_ON_SCAVENGE);
- }
MemoryChunk* next_element = next_chunk();
MemoryChunk* prev_element = prev_chunk();
next_element->set_prev_chunk(prev_element);
@@ -930,7 +926,8 @@ PagedSpace::PagedSpace(Heap* heap,
: Space(heap, id, executable),
free_list_(this),
was_swept_conservatively_(false),
- unswept_free_bytes_(0) {
+ unswept_free_bytes_(0),
+ end_of_unswept_pages_(NULL) {
if (id == CODE_SPACE) {
area_size_ = heap->isolate()->memory_allocator()->
CodePageAreaSize();
@@ -1103,7 +1100,7 @@ void PagedSpace::IncreaseCapacity(int size) {
}
-void PagedSpace::ReleasePage(Page* page, bool unlink) {
+void PagedSpace::ReleasePage(Page* page) {
ASSERT(page->LiveBytes() == 0);
ASSERT(AreaSize() == page->area_size());
@@ -1115,6 +1112,11 @@ void PagedSpace::ReleasePage(Page* page, bool unlink) {
DecreaseUnsweptFreeBytes(page);
}
+ if (page->IsFlagSet(MemoryChunk::SCAN_ON_SCAVENGE)) {
+ heap()->decrement_scan_on_scavenge_pages();
+ page->ClearFlag(MemoryChunk::SCAN_ON_SCAVENGE);
+ }
+
ASSERT(!free_list_.ContainsPageFreeListItems(page));
if (Page::FromAllocationTop(allocation_info_.top()) == page) {
@@ -1122,9 +1124,7 @@ void PagedSpace::ReleasePage(Page* page, bool unlink) {
allocation_info_.set_limit(NULL);
}
- if (unlink) {
- page->Unlink();
- }
+ page->Unlink();
if (page->IsFlagSet(MemoryChunk::CONTAINS_ONLY_DATA)) {
heap()->isolate()->memory_allocator()->Free(page);
} else {
« no previous file with comments | « src/spaces.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698