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

Unified Diff: src/heap/scavenger-inl.h

Issue 1994933002: [heap] Get rid of the wrapper in remembered-set.h (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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
« no previous file with comments | « src/heap/scavenger.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/scavenger-inl.h
diff --git a/src/heap/scavenger-inl.h b/src/heap/scavenger-inl.h
index b8fd1c8292fb18f2250f4fd1178e163528ccd6e6..9edf0511768a960760940ebb4b026ba873d254c5 100644
--- a/src/heap/scavenger-inl.h
+++ b/src/heap/scavenger-inl.h
@@ -37,6 +37,29 @@ void Scavenger::ScavengeObject(HeapObject** p, HeapObject* object) {
return ScavengeObjectSlow(p, object);
}
+SlotCallbackResult Scavenger::CheckAndScavengeObject(Heap* heap,
+ Address slot_address) {
+ Object** slot = reinterpret_cast<Object**>(slot_address);
+ Object* object = *slot;
+ if (heap->InFromSpace(object)) {
+ HeapObject* heap_object = reinterpret_cast<HeapObject*>(object);
+ DCHECK(heap_object->IsHeapObject());
+
+ ScavengeObject(reinterpret_cast<HeapObject**>(slot), heap_object);
+
+ object = *slot;
+ // If the object was in from space before and is after executing the
+ // callback in to space, the object is still live.
+ // Unfortunately, we do not know about the slot. It could be in a
+ // just freed free space object.
+ if (heap->InToSpace(object)) {
+ return KEEP_SLOT;
+ }
+ } else {
+ DCHECK(!heap->InNewSpace(object));
+ }
+ return REMOVE_SLOT;
+}
// static
void StaticScavengeVisitor::VisitPointer(Heap* heap, HeapObject* obj,
« no previous file with comments | « src/heap/scavenger.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698