#include "src/heap/cppgc/concurrent-marker.h"
#include "include/cppgc/platform.h"
#include "src/heap/cppgc/heap-base.h"
#include "src/heap/cppgc/heap-object-header.h"
#include "src/heap/cppgc/marking-state.h"
#include "src/heap/cppgc/marking-visitor.h"
#include "src/heap/cppgc/stats-collector.h"
namespace cppgc {
namespace internal {
namespace {
static constexpr double kMarkingScheduleRatioBeforeConcurrentPriorityIncrease = …;
static constexpr size_t kDefaultDeadlineCheckInterval = …;
template <size_t kDeadlineCheckInterval = kDefaultDeadlineCheckInterval,
typename WorklistLocal, typename Callback>
bool DrainWorklistWithYielding(
JobDelegate* job_delegate, ConcurrentMarkingState& marking_state,
heap::base::IncrementalMarkingSchedule& incremental_marking_schedule,
WorklistLocal& worklist_local, Callback callback) { … }
size_t WorkSizeForConcurrentMarking(MarkingWorklists& marking_worklists) { … }
bool HasWorkForConcurrentMarking(MarkingWorklists& marking_worklists) { … }
class ConcurrentMarkingTask final : public v8::JobTask { … };
ConcurrentMarkingTask::ConcurrentMarkingTask(
ConcurrentMarkerBase& concurrent_marker)
: … { … }
void ConcurrentMarkingTask::Run(JobDelegate* job_delegate) { … }
size_t ConcurrentMarkingTask::GetMaxConcurrency(
size_t current_worker_count) const { … }
void ConcurrentMarkingTask::ProcessWorklists(
JobDelegate* job_delegate, ConcurrentMarkingState& concurrent_marking_state,
Visitor& concurrent_marking_visitor) { … }
}
ConcurrentMarkerBase::ConcurrentMarkerBase(
HeapBase& heap, MarkingWorklists& marking_worklists,
heap::base::IncrementalMarkingSchedule& incremental_marking_schedule,
cppgc::Platform* platform)
: … { … }
void ConcurrentMarkerBase::Start() { … }
bool ConcurrentMarkerBase::Join() { … }
bool ConcurrentMarkerBase::Cancel() { … }
bool ConcurrentMarkerBase::IsActive() const { … }
ConcurrentMarkerBase::~ConcurrentMarkerBase() { … }
void ConcurrentMarkerBase::NotifyIncrementalMutatorStepCompleted() { … }
void ConcurrentMarkerBase::NotifyOfWorkIfNeeded(cppgc::TaskPriority priority) { … }
void ConcurrentMarkerBase::IncreaseMarkingPriorityIfNeeded() { … }
std::unique_ptr<Visitor> ConcurrentMarker::CreateConcurrentMarkingVisitor(
ConcurrentMarkingState& marking_state) const { … }
}
}