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

Unified Diff: src/heap/heap.cc

Issue 2002013002: [heap] Pass a force_promotion flag to the evacuation routine in the scavenger. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. 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/heap.h ('k') | src/heap/scavenger.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index bc8bfe3215383fa4a03a6664286dcd51bef0ec00..3c21f777e5d3f378997d694df3d256645b2d2bf2 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -1670,15 +1670,18 @@ void Heap::Scavenge() {
// Copy objects reachable from the old generation.
TRACE_GC(tracer(), GCTracer::Scope::SCAVENGER_OLD_TO_NEW_POINTERS);
RememberedSet<OLD_TO_NEW>::Iterate(this, [this](Address addr) {
- return Scavenger::CheckAndScavengeObject(this, addr);
+ return Scavenger::CheckAndScavengeObject(this, addr, DEFAULT_PROMOTION);
});
RememberedSet<OLD_TO_NEW>::IterateTyped(
this, [this](SlotType type, Address addr) {
return UpdateTypedSlotHelper::UpdateTypedSlot(
isolate(), type, addr, [this](Object** addr) {
+ // We expect that objects referenced by code are long living.
+ // If we do not force promotion, then we need to clear
+ // old_to_new slots in dead code objects after mark-compact.
return Scavenger::CheckAndScavengeObject(
- this, reinterpret_cast<Address>(addr));
+ this, reinterpret_cast<Address>(addr), FORCE_PROMOTION);
});
});
}
@@ -4666,8 +4669,8 @@ void Heap::IteratePromotedObjectPointers(HeapObject* object, Address start,
Object* target = *slot;
if (target->IsHeapObject()) {
if (Heap::InFromSpace(target)) {
- callback(reinterpret_cast<HeapObject**>(slot),
- HeapObject::cast(target));
+ callback(reinterpret_cast<HeapObject**>(slot), HeapObject::cast(target),
+ DEFAULT_PROMOTION);
Object* new_target = *slot;
if (InNewSpace(new_target)) {
SLOW_DCHECK(Heap::InToSpace(new_target));
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/scavenger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698