chromium/v8/src/heap/mark-sweep-utilities.h

// Copyright 2023 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_HEAP_MARK_SWEEP_UTILITIES_H_
#define V8_HEAP_MARK_SWEEP_UTILITIES_H_

#include <memory>
#include <vector>

#include "src/common/globals.h"
#include "src/heap/heap.h"
#include "src/heap/marking-state.h"
#include "src/heap/marking-worklist.h"
#include "src/heap/spaces.h"
#include "src/objects/string-forwarding-table.h"
#include "src/objects/visitors.h"

namespace v8 {
namespace internal {

#ifdef VERIFY_HEAP
class MarkingVerifierBase : public ObjectVisitorWithCageBases,
                            public RootVisitor {};
#endif  // VERIFY_HEAP

enum class ExternalStringTableCleaningMode {};
template <ExternalStringTableCleaningMode mode>
class ExternalStringTableCleanerVisitor final : public RootVisitor {};

class StringForwardingTableCleanerBase {};

bool IsCppHeapMarkingFinished(Heap* heap,
                              MarkingWorklists::Local* local_marking_worklists);

#if DEBUG
void VerifyRememberedSetsAfterEvacuation(Heap* heap,
                                         GarbageCollector garbage_collector);
#endif  // DEBUG

template class ExternalStringTableCleanerVisitor<
    ExternalStringTableCleaningMode::kAll>;
template class ExternalStringTableCleanerVisitor<
    ExternalStringTableCleaningMode::kYoungOnly>;

}  // namespace internal
}  // namespace v8

#endif  // V8_HEAP_MARK_SWEEP_UTILITIES_H_