chromium/v8/src/heap/read-only-heap.h

// Copyright 2019 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_READ_ONLY_HEAP_H_
#define V8_HEAP_READ_ONLY_HEAP_H_

#include <memory>
#include <utility>
#include <vector>

#include "src/base/macros.h"
#include "src/objects/heap-object.h"
#include "src/objects/objects.h"
#include "src/roots/roots.h"
#include "src/sandbox/code-pointer-table.h"
#include "src/sandbox/js-dispatch-table.h"

namespace v8 {

class SharedMemoryStatistics;

namespace internal {

class MemoryChunkMetadata;
class Isolate;
class PageMetadata;
class ReadOnlyArtifacts;
class ReadOnlyPageMetadata;
class ReadOnlySpace;
class SharedReadOnlySpace;
class SnapshotData;

// This class transparently manages read-only space, roots and cache creation
// and destruction.
class ReadOnlyHeap {};

// This is used without pointer compression when there is just a single
// ReadOnlyHeap object shared between all Isolates.
class SoleReadOnlyHeap : public ReadOnlyHeap {};

enum class SkipFreeSpaceOrFiller {};

// This class enables iterating over all read-only heap objects on a
// ReadOnlyPage.
class V8_EXPORT_PRIVATE ReadOnlyPageObjectIterator final {};

// This class enables iterating over all read-only heap objects in the
// ReadOnlyHeap/ReadOnlySpace.
class V8_EXPORT_PRIVATE ReadOnlyHeapObjectIterator final {};

}  // namespace internal
}  // namespace v8

#endif  // V8_HEAP_READ_ONLY_HEAP_H_