#include "src/heap/cppgc/marker.h"
#include <cstddef>
#include <cstdint>
#include <memory>
#include "include/cppgc/heap-consistency.h"
#include "include/cppgc/platform.h"
#include "src/base/platform/time.h"
#include "src/heap/base/incremental-marking-schedule.h"
#include "src/heap/cppgc/globals.h"
#include "src/heap/cppgc/heap-config.h"
#include "src/heap/cppgc/heap-object-header.h"
#include "src/heap/cppgc/heap-page.h"
#include "src/heap/cppgc/heap-visitor.h"
#include "src/heap/cppgc/heap.h"
#include "src/heap/cppgc/liveness-broker.h"
#include "src/heap/cppgc/marking-state.h"
#include "src/heap/cppgc/marking-visitor.h"
#include "src/heap/cppgc/marking-worklists.h"
#include "src/heap/cppgc/process-heap.h"
#include "src/heap/cppgc/stats-collector.h"
#include "src/heap/cppgc/write-barrier.h"
#if defined(CPPGC_CAGED_HEAP)
#include "include/cppgc/internal/caged-heap-local-data.h"
#endif
namespace cppgc {
namespace internal {
namespace {
bool EnterIncrementalMarkingIfNeeded(MarkingConfig config, HeapBase& heap) { … }
bool ExitIncrementalMarkingIfNeeded(MarkingConfig config, HeapBase& heap) { … }
static constexpr size_t kDefaultDeadlineCheckInterval = …;
template <size_t kDeadlineCheckInterval = kDefaultDeadlineCheckInterval,
typename WorklistLocal, typename Callback>
bool DrainWorklistWithBytesAndTimeDeadline(BasicMarkingState& marking_state,
size_t marked_bytes_deadline,
v8::base::TimeTicks time_deadline,
WorklistLocal& worklist_local,
Callback callback) { … }
size_t GetNextIncrementalStepDuration(
heap::base::IncrementalMarkingSchedule& schedule, HeapBase& heap) { … }
}
constexpr v8::base::TimeDelta MarkerBase::kMaximumIncrementalStepDuration;
class MarkerBase::IncrementalMarkingTask final : public cppgc::Task { … };
MarkerBase::IncrementalMarkingTask::IncrementalMarkingTask(
MarkerBase* marker, StackState stack_state)
: … { … }
MarkerBase::IncrementalMarkingTask::Handle
MarkerBase::IncrementalMarkingTask::Post(cppgc::TaskRunner* runner,
MarkerBase* marker) { … }
void MarkerBase::IncrementalMarkingTask::Run() { … }
MarkerBase::MarkerBase(HeapBase& heap, cppgc::Platform* platform,
MarkingConfig config)
: … { … }
MarkerBase::~MarkerBase() { … }
class MarkerBase::IncrementalMarkingAllocationObserver final
: public StatsCollector::AllocationObserver { … };
void MarkerBase::StartMarking() { … }
void MarkerBase::HandleNotFullyConstructedObjects() { … }
void MarkerBase::EnterAtomicPause(StackState stack_state) { … }
void MarkerBase::ReEnableConcurrentMarking() { … }
void MarkerBase::LeaveAtomicPause() { … }
void MarkerBase::EnterProcessGlobalAtomicPause() { … }
void MarkerBase::FinishMarking(StackState stack_state) { … }
class WeakCallbackJobTask final : public cppgc::JobTask { … };
class WeakPersistentJobTask final : public cppgc::JobTask { … };
void MarkerBase::ProcessWeakness() { … }
void MarkerBase::VisitLocalRoots(StackState stack_state) { … }
void MarkerBase::VisitCrossThreadRoots() { … }
void MarkerBase::ScheduleIncrementalMarkingTask() { … }
bool MarkerBase::IncrementalMarkingStepForTesting(StackState stack_state) { … }
bool MarkerBase::IncrementalMarkingStep(StackState stack_state) { … }
void MarkerBase::AdvanceMarkingOnAllocation() { … }
bool MarkerBase::JoinConcurrentMarkingIfNeeded() { … }
void MarkerBase::NotifyConcurrentMarkingOfWorkIfNeeded(
cppgc::TaskPriority priority) { … }
bool MarkerBase::AdvanceMarkingWithLimits(v8::base::TimeDelta max_duration,
size_t marked_bytes_limit) { … }
bool MarkerBase::ProcessWorklistsWithDeadline(
size_t marked_bytes_deadline, v8::base::TimeTicks time_deadline) { … }
void MarkerBase::MarkNotFullyConstructedObjects() { … }
bool MarkerBase::IsAheadOfSchedule() const { … }
void MarkerBase::ClearAllWorklistsForTesting() { … }
void MarkerBase::SetMainThreadMarkingDisabledForTesting(bool value) { … }
void MarkerBase::WaitForConcurrentMarkingForTesting() { … }
MarkerBase::PauseConcurrentMarkingScope::PauseConcurrentMarkingScope(
MarkerBase& marker)
: … { … }
MarkerBase::PauseConcurrentMarkingScope::~PauseConcurrentMarkingScope() { … }
Marker::Marker(HeapBase& heap, cppgc::Platform* platform, MarkingConfig config)
: … { … }
}
}