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

Unified Diff: src/heap.cc

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/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index 6e0bb5556e975e6367939a1fbd30a7aefea59c5a..d5aaac4e40e24016d8669b044c7f01d34166d394 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -4304,13 +4304,20 @@ void Heap::IterateAndMarkPointersToFromSpace(Address start,
// the store buffer. These pages are scanned to find pointers that point
// to the new space. In that case we may hit newly promoted objects and
// fix the pointers before the promotion queue gets to them. Thus the 'if'.
- if (Heap::InFromSpace(object)) {
- callback(reinterpret_cast<HeapObject**>(slot), HeapObject::cast(object));
- if (InNewSpace(*slot)) {
- ASSERT(Heap::InToSpace(*slot));
- ASSERT((*slot)->IsHeapObject());
- store_buffer_.EnterDirectlyIntoStoreBuffer(
- reinterpret_cast<Address>(slot));
+ if (object->IsHeapObject()) {
+ if (Heap::InFromSpace(object)) {
+ callback(reinterpret_cast<HeapObject**>(slot),
+ HeapObject::cast(object));
+ Object* new_object = *slot;
+ if (InNewSpace(new_object)) {
+ ASSERT(Heap::InToSpace(new_object));
+ ASSERT(new_object->IsHeapObject());
+ store_buffer_.EnterDirectlyIntoStoreBuffer(
+ reinterpret_cast<Address>(slot));
+ }
+ ASSERT(!MarkCompactCollector::IsOnEvacuationCandidate(new_object));
+ } else if (MarkCompactCollector::IsOnEvacuationCandidate(object)) {
+ mark_compact_collector()->RecordSlot(slot, slot, object);
Erik Corry 2011/07/04 11:04:11 Does this happen? The pointer can't suddenly star
Vyacheslav Egorov (Chromium) 2011/08/05 12:50:28 This else if belongs to the first if. So yes this
}
}
slot_address += kPointerSize;
« no previous file with comments | « src/assembler.cc ('k') | src/ia32/assembler-ia32-inl.h » ('j') | src/ia32/assembler-ia32-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698