diff options
Diffstat (limited to 'deps/v8/src/heap/incremental-marking.h')
-rw-r--r-- | deps/v8/src/heap/incremental-marking.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/deps/v8/src/heap/incremental-marking.h b/deps/v8/src/heap/incremental-marking.h index 04000be352c..7d06c086499 100644 --- a/deps/v8/src/heap/incremental-marking.h +++ b/deps/v8/src/heap/incremental-marking.h @@ -28,7 +28,7 @@ enum class StepResult { class V8_EXPORT_PRIVATE IncrementalMarking final { public: - enum State { STOPPED, SWEEPING, MARKING, COMPLETE }; + enum State : uint8_t { STOPPED, SWEEPING, MARKING, COMPLETE }; enum CompletionAction { GC_VIA_STACK_GUARD, NO_GC_VIA_STACK_GUARD }; @@ -317,7 +317,10 @@ class V8_EXPORT_PRIVATE IncrementalMarking final { size_t bytes_marked_concurrently_ = 0; // Must use SetState() above to update state_ - State state_; + // Atomic since main thread can complete marking (= changing state), while a + // background thread's slow allocation path will check whether incremental + // marking is currently running. + std::atomic<State> state_; bool is_compacting_ = false; bool was_activated_ = false; @@ -325,7 +328,7 @@ class V8_EXPORT_PRIVATE IncrementalMarking final { bool finalize_marking_completed_ = false; IncrementalMarkingJob incremental_marking_job_; - GCRequestType request_type_ = NONE; + std::atomic<GCRequestType> request_type_{NONE}; Observer new_generation_observer_; Observer old_generation_observer_; |