v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
large-page-metadata.cc
Go to the documentation of this file.
1// Copyright 2023 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
6
12
13namespace v8 {
14namespace internal {
15
16class Heap;
17
19 size_t chunk_size, Address area_start,
20 Address area_end,
21 VirtualMemory reservation,
22 Executability executable)
23 : MutablePageMetadata(heap, space, chunk_size, area_start, area_end,
24 std::move(reservation), PageSize::kLarge) {
27
29
30 if (executable && chunk_size > LargePageMetadata::kMaxCodePageSize) {
31 FATAL("Code page is too large.");
32 }
33
34 list_node().Initialize();
35}
36
42
46
49
52
58
59 // area_end() might not be aligned to a full bucket size with large objects.
60 // Align it to bucket size such that the following RemoveRange invocation just
61 // drops the whole bucket and the bucket is reset to nullptr.
62 Address aligned_area_end =
64 DCHECK_LE(area_end(), aligned_area_end);
65 RememberedSet<OLD_TO_SHARED>::RemoveRange(this, free_start, aligned_area_end,
67
69}
70
71} // namespace internal
72} // namespace v8
static constexpr size_t OffsetForBucket(size_t bucket_index)
MemoryChunk::MainThreadFlags InitialFlags(Executability executable) const
LargePageMetadata(Heap *heap, BaseSpace *space, size_t chunk_size, Address area_start, Address area_end, VirtualMemory reservation, Executability executable)
void ClearOutOfLiveRangeSlots(Address free_start)
MemoryChunk::MainThreadFlags InitialFlags(Executability executable) const
heap::ListNode< MutablePageMetadata > & list_node()
static void RemoveRangeTyped(MutablePageMetadata *page, Address start, Address end)
static void RemoveRange(MutablePageMetadata *chunk, Address start, Address end, SlotSet::EmptyBucketMode mode)
static const int kMaxOffset
Definition slot-set.h:275
STL namespace.
#define FATAL(...)
Definition logging.h:47
#define DCHECK_LE(v1, v2)
Definition logging.h:490
#define DCHECK_NULL(val)
Definition logging.h:491
#define DCHECK(condition)
Definition logging.h:482