v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
memory-chunk-metadata-inl.h
Go to the documentation of this file.
1// Copyright 2024 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_MEMORY_CHUNK_METADATA_INL_H_
6#define V8_HEAP_MEMORY_CHUNK_METADATA_INL_H_
7
9// Include the non-inl header before the rest of the headers.
10
12
13namespace v8 {
14namespace internal {
15
16// static
20
21// static
25
26// static
31
32// static
34 if (mark == kNullAddress) return;
35 // Need to subtract one from the mark because when a chunk is full the
36 // top points to the next address after the chunk, which effectively belongs
37 // to another chunk. See the comment to
38 // PageMetadata::FromAllocationAreaAddress.
40 intptr_t new_mark = static_cast<intptr_t>(mark - chunk->ChunkAddress());
41 intptr_t old_mark = chunk->high_water_mark_.load(std::memory_order_relaxed);
42 while ((new_mark > old_mark) &&
43 !chunk->high_water_mark_.compare_exchange_weak(
44 old_mark, new_mark, std::memory_order_acq_rel)) {
45 }
46}
47
48} // namespace internal
49} // namespace v8
50
51#endif // V8_HEAP_MEMORY_CHUNK_METADATA_INL_H_
static V8_INLINE MemoryChunkMetadata * FromHeapObject(Tagged< HeapObject > o)
static V8_INLINE MemoryChunkMetadata * FromAddress(Address a)
static V8_INLINE void UpdateHighWaterMark(Address mark)
V8_INLINE MemoryChunkMetadata * Metadata()
static V8_INLINE MemoryChunk * FromAddress(Address addr)
V8_INLINE constexpr StorageType ptr() const
static constexpr Address kNullAddress
Definition v8-internal.h:53