| Index: src/heap/scavenger.h
|
| diff --git a/src/heap/scavenger.h b/src/heap/scavenger.h
|
| index 3db2e5d470f797a759bec2ccca7a40868f4a119c..a7c793dafd4ae9fc20215ab661d118d077b78872 100644
|
| --- a/src/heap/scavenger.h
|
| +++ b/src/heap/scavenger.h
|
| @@ -12,8 +12,7 @@ namespace v8 {
|
| namespace internal {
|
|
|
| typedef void (*ScavengingCallback)(Map* map, HeapObject** slot,
|
| - HeapObject* object,
|
| - PromotionMode promotion_mode);
|
| + HeapObject* object);
|
|
|
| class Scavenger {
|
| public:
|
| @@ -26,15 +25,14 @@ class Scavenger {
|
| // necessary, the object might be promoted to an old space. The caller must
|
| // ensure the precondition that the object is (a) a heap object and (b) in
|
| // the heap's from space.
|
| - static inline void ScavengeObject(
|
| - HeapObject** p, HeapObject* object,
|
| - PromotionMode promotion_mode = DEFAULT_PROMOTION);
|
| + template <PromotionMode promotion_mode>
|
| + static inline void ScavengeObject(HeapObject** p, HeapObject* object);
|
| static inline SlotCallbackResult CheckAndScavengeObject(
|
| Heap* heap, Address slot_address, PromotionMode promotion_mode);
|
|
|
| // Slow part of {ScavengeObject} above.
|
| - static void ScavengeObjectSlow(HeapObject** p, HeapObject* object,
|
| - PromotionMode promotion_mode);
|
| + template <PromotionMode promotion_mode>
|
| + static void ScavengeObjectSlow(HeapObject** p, HeapObject* object);
|
|
|
| // Chooses an appropriate static visitor table depending on the current state
|
| // of the heap (i.e. incremental marking, logging and profiling).
|
| @@ -53,7 +51,8 @@ class Scavenger {
|
| // filtering out non-HeapObjects and objects which do not reside in new space.
|
| class ScavengeVisitor : public ObjectVisitor {
|
| public:
|
| - explicit ScavengeVisitor(Heap* heap) : heap_(heap) {}
|
| + ScavengeVisitor(Heap* heap, PromotionMode promotion_mode)
|
| + : heap_(heap), promotion_mode_(promotion_mode) {}
|
|
|
| void VisitPointer(Object** p) override;
|
| void VisitPointers(Object** start, Object** end) override;
|
| @@ -62,13 +61,15 @@ class ScavengeVisitor : public ObjectVisitor {
|
| inline void ScavengePointer(Object** p);
|
|
|
| Heap* heap_;
|
| + PromotionMode promotion_mode_;
|
| };
|
|
|
|
|
| // Helper class for turning the scavenger into an object visitor that is also
|
| // filtering out non-HeapObjects and objects which do not reside in new space.
|
| +template <PromotionMode promotion_mode>
|
| class StaticScavengeVisitor
|
| - : public StaticNewSpaceVisitor<StaticScavengeVisitor> {
|
| + : public StaticNewSpaceVisitor<StaticScavengeVisitor<promotion_mode>> {
|
| public:
|
| static inline void VisitPointer(Heap* heap, HeapObject* object, Object** p);
|
| };
|
|
|