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

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

Issue 2005173003: Immediatelly promote marked objects (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Really should concentrate more 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.cc ('k') | test/cctest/heap/test-heap.cc » ('j') | 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 3b96f648f79a818121e2076d961687680aed2bf3..0b6a0f48dfc2bb7c839b51cb571009ec225337b4 100644
--- a/src/heap/scavenger-inl.h
+++ b/src/heap/scavenger-inl.h
@@ -10,8 +10,7 @@
namespace v8 {
namespace internal {
-void Scavenger::ScavengeObject(HeapObject** p, HeapObject* object,
- PromotionMode promotion_mode) {
+void Scavenger::ScavengeObject(HeapObject** p, HeapObject* object) {
DCHECK(object->GetIsolate()->heap()->InFromSpace(object));
// We use the first word (where the map pointer usually is) of a heap
@@ -35,19 +34,18 @@ void Scavenger::ScavengeObject(HeapObject** p, HeapObject* object,
// AllocationMementos are unrooted and shouldn't survive a scavenge
DCHECK(object->map() != object->GetHeap()->allocation_memento_map());
// Call the slow part of scavenge object.
- return ScavengeObjectSlow(p, object, promotion_mode);
+ return ScavengeObjectSlow(p, object);
}
-SlotCallbackResult Scavenger::CheckAndScavengeObject(
- Heap* heap, Address slot_address, PromotionMode promotion_mode) {
+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,
- promotion_mode);
+ ScavengeObject(reinterpret_cast<HeapObject**>(slot), heap_object);
object = *slot;
// If the object was in from space before and is after executing the
@@ -64,13 +62,14 @@ SlotCallbackResult Scavenger::CheckAndScavengeObject(
}
// static
-void StaticScavengeVisitor::VisitPointer(Heap* heap, HeapObject* obj,
- Object** p) {
+template <PromotionMode promotion_mode>
+void StaticScavengeVisitor<promotion_mode>::VisitPointer(Heap* heap,
+ HeapObject* obj,
+ Object** p) {
Object* object = *p;
if (!heap->InNewSpace(object)) return;
Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p),
- reinterpret_cast<HeapObject*>(object),
- DEFAULT_PROMOTION);
+ reinterpret_cast<HeapObject*>(object));
}
} // namespace internal
« no previous file with comments | « src/heap/scavenger.cc ('k') | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698