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

Unified Diff: src/heap/incremental-marking.cc

Issue 1259613006: Change RecordSlot interface. Make it more robust by replacing anchor slot with actual object. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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/heap/heap.cc ('k') | src/heap/mark-compact.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/incremental-marking.cc
diff --git a/src/heap/incremental-marking.cc b/src/heap/incremental-marking.cc
index 947c961af8993d6efc959d4d1c7765a1c2e352a1..6b447715c895843e09040e617166debcdb11b44b 100644
--- a/src/heap/incremental-marking.cc
+++ b/src/heap/incremental-marking.cc
@@ -40,8 +40,7 @@ void IncrementalMarking::RecordWriteSlow(HeapObject* obj, Object** slot,
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);
+ heap_->mark_compact_collector()->RecordSlot(obj, slot, value);
}
}
}
@@ -92,7 +91,7 @@ void IncrementalMarking::RecordWriteOfCodeEntrySlow(JSFunction* host,
if (BaseRecordWrite(host, slot, value)) {
DCHECK(slot != NULL);
heap_->mark_compact_collector()->RecordCodeEntrySlot(
- reinterpret_cast<Address>(slot), value);
+ host, reinterpret_cast<Address>(slot), value);
}
}
@@ -177,9 +176,8 @@ class IncrementalMarkingMarkingVisitor
int already_scanned_offset = start_offset;
bool scan_until_end = false;
do {
- VisitPointersWithAnchor(heap, HeapObject::RawField(object, 0),
- HeapObject::RawField(object, start_offset),
- HeapObject::RawField(object, end_offset));
+ VisitPointers(heap, object, HeapObject::RawField(object, start_offset),
+ HeapObject::RawField(object, end_offset));
start_offset = end_offset;
end_offset = Min(object_size, end_offset + kProgressBarScanningChunk);
scan_until_end =
@@ -214,31 +212,21 @@ class IncrementalMarkingMarkingVisitor
VisitNativeContext(map, context);
}
- INLINE(static void VisitPointer(Heap* heap, Object** p)) {
- Object* obj = *p;
- if (obj->IsHeapObject()) {
- heap->mark_compact_collector()->RecordSlot(p, p, obj);
- MarkObject(heap, obj);
- }
- }
-
- INLINE(static void VisitPointers(Heap* heap, Object** start, Object** end)) {
- for (Object** p = start; p < end; p++) {
- Object* obj = *p;
- if (obj->IsHeapObject()) {
- heap->mark_compact_collector()->RecordSlot(start, p, obj);
- MarkObject(heap, obj);
- }
+ INLINE(static void VisitPointer(Heap* heap, HeapObject* object, Object** p)) {
+ Object* target = *p;
+ if (target->IsHeapObject()) {
+ heap->mark_compact_collector()->RecordSlot(object, p, target);
+ MarkObject(heap, target);
}
}
- INLINE(static void VisitPointersWithAnchor(Heap* heap, Object** anchor,
- Object** start, Object** end)) {
+ INLINE(static void VisitPointers(Heap* heap, HeapObject* object,
+ Object** start, Object** end)) {
for (Object** p = start; p < end; p++) {
- Object* obj = *p;
- if (obj->IsHeapObject()) {
- heap->mark_compact_collector()->RecordSlot(anchor, p, obj);
- MarkObject(heap, obj);
+ Object* target = *p;
+ if (target->IsHeapObject()) {
+ heap->mark_compact_collector()->RecordSlot(object, p, target);
+ MarkObject(heap, target);
}
}
}
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/mark-compact.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698