Index: src/heap/mark-compact.h |
diff --git a/src/heap/mark-compact.h b/src/heap/mark-compact.h |
index 9952b7953dfb154e73e81eccfb4e260a04a3e98b..0ad236be600bbf3a6c016f75c699485d6c634410 100644 |
--- a/src/heap/mark-compact.h |
+++ b/src/heap/mark-compact.h |
@@ -46,6 +46,54 @@ class ObjectMarking : public AllStatic { |
return Marking::Color(ObjectMarking::MarkBitFrom(obj)); |
} |
+ V8_INLINE static void MarkWhite(HeapObject* obj) { |
+ MarkBit markbit = MarkBitFrom(obj); |
+ if (Marking::IsBlack(markbit)) { |
+ MemoryChunk::IncrementLiveBytes(obj, -obj->Size()); |
+ } |
+ Marking::MarkWhite(markbit); |
+ } |
+ |
Hannes Payer (out of office)
2017/01/18 14:43:35
Should we add DCHECKs to the transitions where we
Michael Lippautz
2017/01/18 15:58:07
Done.
|
+ V8_INLINE static void BlackToWhite(HeapObject* obj) { |
+ MarkBit markbit = MarkBitFrom(obj); |
+ Marking::BlackToWhite(markbit); |
+ MemoryChunk::IncrementLiveBytes(obj, -obj->Size()); |
+ } |
+ |
+ V8_INLINE static void GreyToWhite(HeapObject* obj) { |
+ Marking::GreyToWhite(MarkBitFrom(obj)); |
+ } |
+ |
+ V8_INLINE static void BlackToGrey(HeapObject* obj) { |
+ MarkBit markbit = MarkBitFrom(obj); |
+ Marking::BlackToGrey(markbit); |
+ MemoryChunk::IncrementLiveBytes(obj, -obj->Size()); |
+ } |
+ |
+ V8_INLINE static void WhiteToGrey(HeapObject* obj) { |
+ Marking::WhiteToGrey(MarkBitFrom(obj)); |
+ } |
+ |
+ V8_INLINE static void WhiteToBlack(HeapObject* obj) { |
+ MarkBit markbit = MarkBitFrom(obj); |
+ Marking::WhiteToBlack(markbit); |
+ MemoryChunk::IncrementLiveBytes(obj, obj->Size()); |
+ } |
+ |
+ V8_INLINE static void GreyToBlack(HeapObject* obj) { |
+ MarkBit markbit = MarkBitFrom(obj); |
+ Marking::GreyToBlack(markbit); |
+ MemoryChunk::IncrementLiveBytes(obj, obj->Size()); |
+ } |
+ |
+ V8_INLINE static void AnyToGrey(HeapObject* obj) { |
+ MarkBit markbit = MarkBitFrom(obj); |
+ if (Marking::IsBlack(markbit)) { |
+ MemoryChunk::IncrementLiveBytes(obj, -obj->Size()); |
+ } |
+ Marking::AnyToGrey(markbit); |
+ } |
+ |
private: |
DISALLOW_IMPLICIT_CONSTRUCTORS(ObjectMarking); |
}; |