5#ifndef V8_HEAP_INCREMENTAL_MARKING_H_
6#define V8_HEAP_INCREMENTAL_MARKING_H_
46 switch (step_origin) {
64 return marking_mode_ == MarkingMode::kMinorMarking;
67 return marking_mode_ == MarkingMode::kMajorMarking;
71 bool IsMarking()
const {
return marking_mode_ != MarkingMode::kNoMarking; }
73 return IsMajorMarking() && ShouldFinalize();
77 return major_collection_requested_via_stack_guard_;
82 bool CanAndShouldBeStarted()
const;
89 void AdvanceAndFinalizeIfComplete();
94 void AdvanceAndFinalizeIfNecessary();
98 void AdvanceOnAllocation();
106 return incremental_marking_job_.get();
111 bool IsBelowActivationThresholds()
const;
115 void MarkRootsForTesting();
119 size_t max_bytes_to_mark = SIZE_MAX);
123 std::shared_ptr<::heap::base::IncrementalMarkingSchedule>
schedule() {
132 void Step(
int bytes_allocated, Address,
size_t)
override;
138 void StartMarkingMajor();
139 void StartMarkingMinor();
142 bool CanBeStarted()
const;
144 void StartBlackAllocation();
145 void PauseBlackAllocation();
146 void FinishBlackAllocation();
148 void StartPointerTableBlackAllocation();
149 void StopPointerTableBlackAllocation();
156 void FetchBytesMarkedConcurrently();
157 size_t GetScheduledBytes(
StepOrigin step_origin);
159 bool ShouldFinalize()
const;
161 bool ShouldWaitForTask();
162 bool TryInitializeTaskTimeout();
165 std::pair<v8::base::TimeDelta, size_t> CppHeapStep(
171 size_t OldGenerationSizeOfObjects()
const;
175 return current_local_marking_worklists_;
185 size_t main_thread_marked_bytes_ = 0;
188 size_t bytes_marked_concurrently_ = 0;
191 bool is_compacting_ =
false;
192 bool black_allocation_ =
false;
193 bool completion_task_scheduled_ =
false;
195 bool major_collection_requested_via_stack_guard_ =
false;
203 std::shared_ptr<::heap::base::IncrementalMarkingSchedule>
schedule_;
IncrementalMarking *const incremental_marking_
~Observer() override=default
std::shared_ptr<::heap::base::IncrementalMarkingSchedule > schedule_
MarkingState * marking_state()
IncrementalMarking & operator=(const IncrementalMarking &)=delete
bool IsMinorMarking() const
uint64_t current_trace_id() const
MarkCompactCollector *const major_collector_
Observer new_generation_observer_
IncrementalMarking(const IncrementalMarking &)=delete
bool MajorCollectionRequested() const
std::unique_ptr< IncrementalMarkingJob > incremental_marking_job_
MinorMarkSweepCollector *const minor_collector_
MarkingState *const marking_state_
std::optional< uint64_t > current_trace_id_
std::shared_ptr<::heap::base::IncrementalMarkingSchedule > schedule()
Observer old_generation_observer_
v8::base::TimeTicks start_time_
MarkingWorklists::Local * local_marking_worklists() const
IncrementalMarkingJob * incremental_marking_job() const
std::unordered_map< MutablePageMetadata *, intptr_t, base::hash< MutablePageMetadata * > > background_live_bytes_
void PublishWriteBarrierWorklists()
base::Mutex background_live_bytes_mutex_
bool IsMajorMarkingComplete() const
WeakObjects * weak_objects_
MarkingMode marking_mode() const
v8::base::TimeTicks completion_task_timeout_
bool IsMajorMarking() const
Schedule const *const schedule_
NonAtomicMarkingState * marking_state_
constexpr const char * ToString(DeoptimizeKind kind)
#define V8_EXPORT_PRIVATE