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

Unified Diff: src/heap/mark-compact.h

Issue 2644523002: [heap] Provide ObjectMarking with marking transitions (Closed)
Patch Set: Created 3 years, 11 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
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);
};

Powered by Google App Engine
This is Rietveld 408576698