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

Unified Diff: src/heap/incremental-marking.h

Issue 2836583002: [heap] Allow concurrently transferring colors (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | src/heap/mark-compact.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/incremental-marking.h
diff --git a/src/heap/incremental-marking.h b/src/heap/incremental-marking.h
index c71328cc508423e2b972851fb3a66bc570aa4f4e..a4678c10270f09bbd23dc339f35e19cbc3962830 100644
--- a/src/heap/incremental-marking.h
+++ b/src/heap/incremental-marking.h
@@ -32,6 +32,32 @@ class V8_EXPORT_PRIVATE IncrementalMarking {
enum GCRequestType { NONE, COMPLETE_MARKING, FINALIZATION };
+ static void MarkGrey(Heap* heap, HeapObject* object);
+
+ static void MarkBlack(HeapObject* object, int size);
+
+ // Transfers mark bits without requiring proper object headers.
+ static void TransferMark(Heap* heap, HeapObject* from, HeapObject* to);
+
+ // Transfers color including live byte count, requiring properly set up
+ // objects.
+ template <MarkBit::AccessMode access_mode = MarkBit::NON_ATOMIC>
+ V8_INLINE static void TransferColor(HeapObject* from, HeapObject* to) {
+ if (ObjectMarking::IsBlack<access_mode>(to, MarkingState::Internal(to))) {
+ DCHECK(to->GetHeap()->incremental_marking()->black_allocation());
+ return;
+ }
+
+ DCHECK(ObjectMarking::IsWhite<access_mode>(to, MarkingState::Internal(to)));
+ if (ObjectMarking::IsGrey<access_mode>(from,
+ MarkingState::Internal(from))) {
+ ObjectMarking::WhiteToGrey<access_mode>(to, MarkingState::Internal(to));
+ } else if (ObjectMarking::IsBlack<access_mode>(
+ from, MarkingState::Internal(from))) {
+ ObjectMarking::WhiteToBlack<access_mode>(to, MarkingState::Internal(to));
+ }
+ }
+
explicit IncrementalMarking(Heap* heap);
static void Initialize();
@@ -179,26 +205,6 @@ class V8_EXPORT_PRIVATE IncrementalMarking {
bool IsIdleMarkingDelayCounterLimitReached();
- static void MarkGrey(Heap* heap, HeapObject* object);
-
- static void MarkBlack(HeapObject* object, int size);
-
- static void TransferMark(Heap* heap, HeapObject* from, HeapObject* to);
-
- V8_INLINE static void TransferColor(HeapObject* from, HeapObject* to) {
- if (ObjectMarking::IsBlack(to, MarkingState::Internal(to))) {
- DCHECK(to->GetHeap()->incremental_marking()->black_allocation());
- return;
- }
-
- DCHECK(ObjectMarking::IsWhite(to, MarkingState::Internal(to)));
- if (ObjectMarking::IsGrey(from, MarkingState::Internal(from))) {
- ObjectMarking::WhiteToGrey(to, MarkingState::Internal(to));
- } else if (ObjectMarking::IsBlack(from, MarkingState::Internal(from))) {
- ObjectMarking::WhiteToBlack(to, MarkingState::Internal(to));
- }
- }
-
void IterateBlackObject(HeapObject* object);
Heap* heap() const { return heap_; }
« no previous file with comments | « no previous file | src/heap/mark-compact.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698