// Copyright 2020 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_CPPGC_PAGE_MEMORY_H_ #define V8_HEAP_CPPGC_PAGE_MEMORY_H_ #include <map> #include <memory> #include <unordered_map> #include <vector> #include "include/cppgc/platform.h" #include "src/base/macros.h" #include "src/base/platform/mutex.h" #include "src/heap/cppgc/globals.h" #include "src/heap/cppgc/heap-config.h" namespace cppgc { namespace internal { class V8_EXPORT_PRIVATE MemoryRegion final { … }; // PageMemory provides the backing of a single normal or large page. class V8_EXPORT_PRIVATE PageMemory final { … }; class V8_EXPORT_PRIVATE PageMemoryRegion final { … }; // A PageMemoryRegionTree is a binary search tree of PageMemoryRegions sorted // by reserved base addresses. // // The tree does not keep its elements alive but merely provides indexing // capabilities. class V8_EXPORT_PRIVATE PageMemoryRegionTree final { … }; // A pool of PageMemory objects represented by the writeable base addresses. // TODO (v8:14390): Consider sharing the page-pool across multiple threads. class V8_EXPORT_PRIVATE NormalPageMemoryPool final { … }; // A backend that is used for allocating and freeing normal and large pages. // // Internally maintains a set of PageMemoryRegions. The backend keeps its used // regions alive. class V8_EXPORT_PRIVATE PageBackend final { … }; // Returns true if the provided allocator supports committing at the required // granularity. inline bool SupportsCommittingGuardPages(PageAllocator& allocator) { … } PageMemoryRegion* PageMemoryRegionTree::Lookup(ConstAddress address) const { … } Address PageBackend::Lookup(ConstAddress address) const { … } } // namespace internal } // namespace cppgc #endif // V8_HEAP_CPPGC_PAGE_MEMORY_H_