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

Unified Diff: src/incremental-marking-inl.h

Issue 7302003: Support slots recording for compaction during incremental marking. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: fix presubmit, remove last debug check Created 9 years, 5 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/incremental-marking.cc ('k') | src/mark-compact.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/incremental-marking-inl.h
diff --git a/src/incremental-marking-inl.h b/src/incremental-marking-inl.h
index c82d67845622451f958950b75a3445429d4cf8aa..94f52eefaa546075a15f6a02d5332e57100cc3c8 100644
--- a/src/incremental-marking-inl.h
+++ b/src/incremental-marking-inl.h
@@ -34,7 +34,9 @@ namespace v8 {
namespace internal {
-void IncrementalMarking::RecordWrite(HeapObject* obj, Object* value) {
+void IncrementalMarking::RecordWrite(HeapObject* obj,
+ Object** slot,
+ Object* value) {
if (IsMarking() && value->IsHeapObject()) {
MarkBit value_bit = Marking::MarkBitFrom(HeapObject::cast(value));
if (Marking::IsWhite(value_bit)) {
@@ -43,6 +45,18 @@ void IncrementalMarking::RecordWrite(HeapObject* obj, Object* value) {
BlackToGreyAndUnshift(obj, obj_bit);
RestartIfNotMarking();
}
+
+ // Object is either grey or white it will be scanned if survives.
+ return;
+ }
+
+ if (is_compacting_ && slot != NULL) {
+ MarkBit obj_bit = Marking::MarkBitFrom(obj);
+ if (Marking::IsBlack(obj_bit)) {
+ // Object is not going to be rescanned we need to record the slot.
+ heap_->mark_compact_collector()->RecordSlot(
+ HeapObject::RawField(obj, 0), slot, value);
+ }
}
}
}
@@ -50,6 +64,8 @@ void IncrementalMarking::RecordWrite(HeapObject* obj, Object* value) {
void IncrementalMarking::RecordWriteOf(HeapObject* value) {
if (IsMarking()) {
+ ASSERT(!MarkCompactCollector::IsOnEvacuationCandidate(value));
+
MarkBit value_bit = Marking::MarkBitFrom(value);
if (Marking::IsWhite(value_bit)) {
WhiteToGreyAndPush(value, value_bit);
« no previous file with comments | « src/incremental-marking.cc ('k') | src/mark-compact.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698