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

Unified Diff: src/mark-compact.h

Issue 2144006: Cardmarking writebarrier. (Closed)
Patch Set: change NewSpace and SemiSpace Contains to match HasHeapObjectTag Created 10 years, 7 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/mark-compact.h
diff --git a/src/mark-compact.h b/src/mark-compact.h
index 3950e7538bfdaf48531223942cee901b59d9a5fa..1d289a75928aefa8fba0c6b2914e03a4769bd376 100644
--- a/src/mark-compact.h
+++ b/src/mark-compact.h
@@ -41,7 +41,8 @@ typedef bool (*IsAliveFunction)(HeapObject* obj, int* size, int* offset);
// no attempt to add area to free list is made.
typedef void (*DeallocateFunction)(Address start,
int size_in_bytes,
- bool add_to_freelist);
+ bool add_to_freelist,
+ bool last_on_page);
// Forward declarations.
@@ -131,8 +132,7 @@ class MarkCompactCollector: public AllStatic {
SWEEP_SPACES,
ENCODE_FORWARDING_ADDRESSES,
UPDATE_POINTERS,
- RELOCATE_OBJECTS,
- REBUILD_RSETS
+ RELOCATE_OBJECTS
};
// The current stage of the collector.
@@ -269,22 +269,22 @@ class MarkCompactCollector: public AllStatic {
// written to their map word's offset in the inactive
// semispace.
//
- // Bookkeeping data is written to the remembered-set are of
+ // Bookkeeping data is written to the page header of
// eached paged-space page that contains live objects after
// compaction:
//
- // The 3rd word of the page (first word of the remembered
- // set) contains the relocation top address, the address of
- // the first word after the end of the last live object in
- // the page after compaction.
+ // The allocation watermark field is used to track the
+ // relocation top address, the address of the first word
+ // after the end of the last live object in the page after
+ // compaction.
//
- // The 4th word contains the zero-based index of the page in
- // its space. This word is only used for map space pages, in
+ // The Page::mc_page_index field contains the zero-based index of the
+ // page in its space. This word is only used for map space pages, in
// order to encode the map addresses in 21 bits to free 11
// bits per map word for the forwarding address.
//
- // The 5th word contains the (nonencoded) forwarding address
- // of the first live object in the page.
+ // The Page::mc_first_forwarded field contains the (nonencoded)
+ // forwarding address of the first live object in the page.
//
// In both the new space and the paged spaces, a linked list
// of live regions is constructructed (linked through
@@ -319,23 +319,28 @@ class MarkCompactCollector: public AllStatic {
// generation.
static void DeallocateOldPointerBlock(Address start,
int size_in_bytes,
- bool add_to_freelist);
+ bool add_to_freelist,
+ bool last_on_page);
static void DeallocateOldDataBlock(Address start,
int size_in_bytes,
- bool add_to_freelist);
+ bool add_to_freelist,
+ bool last_on_page);
static void DeallocateCodeBlock(Address start,
int size_in_bytes,
- bool add_to_freelist);
+ bool add_to_freelist,
+ bool last_on_page);
static void DeallocateMapBlock(Address start,
int size_in_bytes,
- bool add_to_freelist);
+ bool add_to_freelist,
+ bool last_on_page);
static void DeallocateCellBlock(Address start,
int size_in_bytes,
- bool add_to_freelist);
+ bool add_to_freelist,
+ bool last_on_page);
// If we are not compacting the heap, we simply sweep the spaces except
// for the large object space, clearing mark bits and adding unmarked
@@ -349,9 +354,7 @@ class MarkCompactCollector: public AllStatic {
//
// After: All pointers in live objects, including encoded map
// pointers, are updated to point to their target's new
- // location. The remembered set area of each paged-space
- // page containing live objects still contains bookkeeping
- // information.
+ // location.
friend class UpdatingVisitor; // helper for updating visited objects
@@ -373,13 +376,9 @@ class MarkCompactCollector: public AllStatic {
// Phase 4: Relocating objects.
//
// Before: Pointers to live objects are updated to point to their
- // target's new location. The remembered set area of each
- // paged-space page containing live objects still contains
- // bookkeeping information.
+ // target's new location.
//
- // After: Objects have been moved to their new addresses. The
- // remembered set area of each paged-space page containing
- // live objects still contains bookkeeping information.
+ // After: Objects have been moved to their new addresses.
// Relocates objects in all spaces.
static void RelocateObjects();
@@ -408,17 +407,6 @@ class MarkCompactCollector: public AllStatic {
// Copy a new object.
static int RelocateNewObject(HeapObject* obj);
- // -----------------------------------------------------------------------
- // Phase 5: Rebuilding remembered sets.
- //
- // Before: The heap is in a normal state except that remembered sets
- // in the paged spaces are not correct.
- //
- // After: The heap is in a normal state.
-
- // Rebuild remembered set in old and map spaces.
- static void RebuildRSets();
-
#ifdef DEBUG
// -----------------------------------------------------------------------
// Debugging variables, functions and classes
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/mark-compact.cc » ('j') | src/spaces.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698