#include "src/heap/minor-mark-sweep.h"
#include <algorithm>
#include <atomic>
#include <memory>
#include <unordered_set>
#include <vector>
#include "src/base/logging.h"
#include "src/codegen/assembler-inl.h"
#include "src/codegen/compilation-cache.h"
#include "src/common/globals.h"
#include "src/deoptimizer/deoptimizer.h"
#include "src/flags/flags.h"
#include "src/handles/global-handles.h"
#include "src/heap/array-buffer-sweeper.h"
#include "src/heap/concurrent-marking.h"
#include "src/heap/ephemeron-remembered-set.h"
#include "src/heap/gc-tracer-inl.h"
#include "src/heap/gc-tracer.h"
#include "src/heap/heap.h"
#include "src/heap/large-spaces.h"
#include "src/heap/mark-sweep-utilities.h"
#include "src/heap/marking-barrier.h"
#include "src/heap/marking-visitor-inl.h"
#include "src/heap/marking-visitor.h"
#include "src/heap/marking-worklist-inl.h"
#include "src/heap/marking-worklist.h"
#include "src/heap/memory-chunk-layout.h"
#include "src/heap/minor-mark-sweep-inl.h"
#include "src/heap/mutable-page-metadata.h"
#include "src/heap/new-spaces.h"
#include "src/heap/object-stats.h"
#include "src/heap/pretenuring-handler.h"
#include "src/heap/read-only-heap.h"
#include "src/heap/read-only-spaces.h"
#include "src/heap/remembered-set.h"
#include "src/heap/safepoint.h"
#include "src/heap/slot-set.h"
#include "src/heap/sweeper.h"
#include "src/heap/traced-handles-marking-visitor.h"
#include "src/heap/weak-object-worklists.h"
#include "src/init/v8.h"
#include "src/objects/js-collection-inl.h"
#include "src/objects/objects.h"
#include "src/objects/string-forwarding-table-inl.h"
#include "src/objects/visitors.h"
#include "src/snapshot/shared-heap-serializer.h"
#include "src/tasks/cancelable-task.h"
#include "src/utils/utils-inl.h"
namespace v8 {
namespace internal {
#ifdef VERIFY_HEAP
namespace {
class YoungGenerationMarkingVerifier : public MarkingVerifierBase { … };
}
#endif
namespace {
int EstimateMaxNumberOfRemeberedSets(Heap* heap) { … }
}
std::vector<YoungGenerationRememberedSetsMarkingWorklist::MarkingItem>
YoungGenerationRememberedSetsMarkingWorklist::CollectItems(Heap* heap) { … }
void YoungGenerationRememberedSetsMarkingWorklist::MarkingItem::
MergeAndDeleteRememberedSets() { … }
void YoungGenerationRememberedSetsMarkingWorklist::MarkingItem::
DeleteRememberedSets() { … }
void YoungGenerationRememberedSetsMarkingWorklist::MarkingItem::
DeleteSetsOnTearDown() { … }
YoungGenerationRememberedSetsMarkingWorklist::
YoungGenerationRememberedSetsMarkingWorklist(Heap* heap)
: … { … }
YoungGenerationRememberedSetsMarkingWorklist::
~YoungGenerationRememberedSetsMarkingWorklist() { … }
void YoungGenerationRememberedSetsMarkingWorklist::TearDown() { … }
YoungGenerationRootMarkingVisitor::YoungGenerationRootMarkingVisitor(
MinorMarkSweepCollector* collector)
: … { … }
YoungGenerationRootMarkingVisitor::~YoungGenerationRootMarkingVisitor() =
default;
constexpr size_t MinorMarkSweepCollector::kMaxParallelTasks;
MinorMarkSweepCollector::MinorMarkSweepCollector(Heap* heap)
: … { … }
void MinorMarkSweepCollector::PerformWrapperTracing() { … }
MinorMarkSweepCollector::~MinorMarkSweepCollector() = default;
void MinorMarkSweepCollector::TearDown() { … }
void MinorMarkSweepCollector::FinishConcurrentMarking() { … }
#ifdef DEBUG
template <typename Space>
static bool ExternalPointerRememberedSetsEmpty(Space* space) { … }
#endif
void MinorMarkSweepCollector::StartMarking(bool force_use_background_threads) { … }
void MinorMarkSweepCollector::Finish() { … }
void MinorMarkSweepCollector::CollectGarbage() { … }
namespace {
class YoungStringForwardingTableCleaner final
: public StringForwardingTableCleanerBase { … };
bool IsUnmarkedObjectInYoungGeneration(Heap* heap, FullObjectSlot p) { … }
}
void MinorMarkSweepCollector::ClearNonLiveReferences() { … }
namespace {
void VisitObjectWithEmbedderFields(Isolate* isolate, Tagged<JSObject> js_object,
MarkingWorklists::Local& worklist) { … }
}
void MinorMarkSweepCollector::MarkRootsFromTracedHandles(
YoungGenerationRootMarkingVisitor& root_visitor) { … }
void MinorMarkSweepCollector::MarkRoots(
YoungGenerationRootMarkingVisitor& root_visitor,
bool was_marked_incrementally) { … }
void MinorMarkSweepCollector::MarkRootsFromConservativeStack(
YoungGenerationRootMarkingVisitor& root_visitor) { … }
void MinorMarkSweepCollector::MarkLiveObjects() { … }
void MinorMarkSweepCollector::DrainMarkingWorklist() { … }
void MinorMarkSweepCollector::TraceFragmentation() { … }
namespace {
intptr_t NewSpacePageEvacuationThreshold() { … }
bool ShouldMovePage(PageMetadata* p, intptr_t live_bytes,
intptr_t wasted_bytes) { … }
}
void MinorMarkSweepCollector::EvacuateExternalPointerReferences(
MutablePageMetadata* p) { … }
bool MinorMarkSweepCollector::StartSweepNewSpace() { … }
void MinorMarkSweepCollector::StartSweepNewSpaceWithStickyBits() { … }
bool MinorMarkSweepCollector::SweepNewLargeSpace() { … }
void MinorMarkSweepCollector::Sweep() { … }
void MinorMarkSweepCollector::RequestGC() { … }
}
}