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

Unified Diff: src/spaces.h

Issue 7302003: Support slots recording for compaction during incremental marking. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 6 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
Index: src/spaces.h
diff --git a/src/spaces.h b/src/spaces.h
index 5b47c34b895b82dfaffa3c24a18101c3b92190fd..0f4bd3ee44fb65fb3d19fe5487f3a0076d8484d1 100644
--- a/src/spaces.h
+++ b/src/spaces.h
@@ -392,9 +392,24 @@ class MemoryChunk {
NEW_SPACE_BELOW_AGE_MARK,
CONTAINS_ONLY_DATA,
EVACUATION_CANDIDATE,
+ EVACUATED,
NUM_MEMORY_CHUNK_FLAGS
};
+
+ static const int kPointersToHereAreInterestingMask =
+ 1 << POINTERS_TO_HERE_ARE_INTERESTING;
+
+ static const int kPointersFromHereAreInterestingMask =
+ 1 << POINTERS_FROM_HERE_ARE_INTERESTING;
+
+ static const int kEvacuationCandidateMask =
+ 1 << EVACUATION_CANDIDATE;
+
+ static const int kEvacuationCandidateOrNewSpaceMask =
+ (1 << EVACUATION_CANDIDATE) | (1 << IN_FROM_SPACE) | (1 << IN_TO_SPACE);
+
+
void SetFlag(int flag) {
flags_ |= (1 << flag);
}
@@ -609,16 +624,19 @@ class Page : public MemoryChunk {
bool IsEvacuationCandidate() { return IsFlagSet(EVACUATION_CANDIDATE); }
bool IsEvacuationCandidateOrNewSpace() {
- intptr_t mask = (1 << EVACUATION_CANDIDATE) |
- (1 << IN_FROM_SPACE) |
- (1 << IN_TO_SPACE);
- return (flags_ & mask) != 0;
+ return (flags_ & kEvacuationCandidateOrNewSpaceMask) != 0;
}
void MarkEvacuationCandidate() { SetFlag(EVACUATION_CANDIDATE); }
void ClearEvacuationCandidate() { ClearFlag(EVACUATION_CANDIDATE); }
+ bool WasEvacuated() { return IsFlagSet(EVACUATED); }
+
+ void MarkEvacuated() { SetFlag(EVACUATED); }
+
+ void ClearEvacuated() { ClearFlag(EVACUATED); }
+
friend class MemoryAllocator;
};
@@ -1035,6 +1053,9 @@ class PageIterator BASE_EMBEDDED {
// space.
class AllocationInfo {
public:
+ AllocationInfo() : top(NULL), limit(NULL) {
+ }
+
Address top; // Current allocation top.
Address limit; // Current allocation limit.
@@ -1228,6 +1249,10 @@ class FreeList BASE_EMBEDDED {
static const int kMinBlockSize = 3 * kPointerSize;
static const int kMaxBlockSize = Page::kMaxHeapObjectSize;
+ FreeListNode* PickNodeFromList(FreeListNode** list, int* node_size);
+
+ FreeListNode* FindNodeFor(int size_in_bytes, int* node_size);
+
PagedSpace* owner_;
Heap* heap_;
@@ -1423,7 +1448,6 @@ class PagedSpace : public Space {
Page* FirstPage() { return anchor_.next_page(); }
Page* LastPage() { return anchor_.prev_page(); }
-
bool IsFragmented(Page* p) {
intptr_t sizes[4];
free_list_.CountFreeListItems(p, sizes);
@@ -1448,6 +1472,8 @@ class PagedSpace : public Space {
return ratio > 15;
}
+ void EvictEvacuationCandidatesFromFreeLists();
+
protected:
// Maximum capacity of this space.
intptr_t max_capacity_;
@@ -2180,10 +2206,6 @@ class OldSpace : public PagedSpace {
return page->ObjectAreaEnd();
}
- // Prepare for full garbage collection. Resets the relocation pointer and
- // clears the free list.
- virtual void PrepareForMarkCompact();
-
public:
TRACK_MEMORY("OldSpace")
};

Powered by Google App Engine
This is Rietveld 408576698