v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
mutable-page-metadata-inl.h
Go to the documentation of this file.
1// Copyright 2020 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
5#ifndef V8_HEAP_MUTABLE_PAGE_METADATA_INL_H_
6#define V8_HEAP_MUTABLE_PAGE_METADATA_INL_H_
7
9// Include the non-inl header before the rest of the headers.
10
12#include "src/heap/spaces-inl.h"
13
14namespace v8 {
15namespace internal {
16
17// static
21
22// static
26
33
40
43 MutablePageMetadata* to, size_t amount) {
44 DCHECK_NOT_NULL(from->owner());
45 DCHECK_NOT_NULL(to->owner());
47 &(from->external_backing_store_bytes_[static_cast<int>(type)]), amount);
49 &(to->external_backing_store_bytes_[static_cast<int>(type)]), amount);
50 Space::MoveExternalBackingStoreBytes(type, from->owner(), to->owner(),
51 amount);
52}
53
55 DCHECK_EQ(owner() == nullptr, Chunk()->InReadOnlySpace());
56 if (!owner()) return RO_SPACE;
57 return owner()->identity();
58}
59
63
64template <AccessMode mode>
69
70} // namespace internal
71} // namespace v8
72
73#endif // V8_HEAP_MUTABLE_PAGE_METADATA_INL_H_
AllocationSpace identity() const
Definition base-space.h:32
static V8_INLINE MemoryChunkMetadata * FromHeapObject(Tagged< HeapObject > o)
static V8_INLINE MemoryChunkMetadata * FromAddress(Address a)
void SetOldGenerationPageFlags(MarkingMode marking_mode, AllocationSpace space)
void DecrementExternalBackingStoreBytes(ExternalBackingStoreType type, size_t amount)
static V8_INLINE MutablePageMetadata * FromAddress(Address a)
std::atomic< size_t > external_backing_store_bytes_[static_cast< int >(ExternalBackingStoreType::kNumValues)]
void IncrementExternalBackingStoreBytes(ExternalBackingStoreType type, size_t amount)
static void MoveExternalBackingStoreBytes(ExternalBackingStoreType type, MutablePageMetadata *from, MutablePageMetadata *to, size_t amount)
V8_INLINE void SetOldGenerationPageFlags(MarkingMode marking_mode)
static V8_INLINE MutablePageMetadata * FromHeapObject(Tagged< HeapObject > o)
static void MoveExternalBackingStoreBytes(ExternalBackingStoreType type, Space *from, Space *to, size_t amount)
Definition spaces-inl.h:50
void IncrementExternalBackingStoreBytes(ExternalBackingStoreType type, size_t amount)
Definition spaces-inl.h:36
void DecrementExternalBackingStoreBytes(ExternalBackingStoreType type, size_t amount)
Definition spaces-inl.h:43
void CheckedDecrement(std::atomic< T > *number, T amount, std::memory_order order=std::memory_order_seq_cst)
void CheckedIncrement(std::atomic< T > *number, T amount, std::memory_order order=std::memory_order_seq_cst)
ExternalBackingStoreType
Definition globals.h:1605
uint32_t cast
#define DCHECK_NOT_NULL(val)
Definition logging.h:492
#define DCHECK_EQ(v1, v2)
Definition logging.h:485