#ifndef V8_HEAP_CPPGC_HEAP_OBJECT_HEADER_H_
#define V8_HEAP_CPPGC_HEAP_OBJECT_HEADER_H_
#include <stdint.h>
#include <atomic>
#include "include/cppgc/allocation.h"
#include "include/cppgc/internal/gc-info.h"
#include "include/cppgc/internal/member-storage.h"
#include "include/cppgc/internal/name-trait.h"
#include "src/base/atomic-utils.h"
#include "src/base/bit-field.h"
#include "src/base/logging.h"
#include "src/base/macros.h"
#include "src/heap/cppgc/gc-info-table.h"
#include "src/heap/cppgc/globals.h"
#if defined(CPPGC_CAGED_HEAP)
#include "src/heap/cppgc/caged-heap.h"
#endif
namespace cppgc {
class Visitor;
namespace internal {
class HeapObjectHeader { … };
static_assert …;
HeapObjectHeader& HeapObjectHeader::FromObject(void* object) { … }
const HeapObjectHeader& HeapObjectHeader::FromObject(const void* object) { … }
HeapObjectHeader::HeapObjectHeader(size_t size, GCInfoIndex gc_info_index) { … }
Address HeapObjectHeader::ObjectStart() const { … }
template <AccessMode mode>
Address HeapObjectHeader::ObjectEnd() const { … }
template <AccessMode mode>
GCInfoIndex HeapObjectHeader::GetGCInfoIndex() const { … }
template <AccessMode mode>
size_t HeapObjectHeader::AllocatedSize() const { … }
void HeapObjectHeader::SetAllocatedSize(size_t size) { … }
template <AccessMode mode>
size_t HeapObjectHeader::ObjectSize() const { … }
template <AccessMode mode>
bool HeapObjectHeader::IsLargeObject() const { … }
template <AccessMode mode>
bool HeapObjectHeader::IsInConstruction() const { … }
void HeapObjectHeader::MarkAsFullyConstructed() { … }
template <AccessMode mode>
bool HeapObjectHeader::IsMarked() const { … }
template <AccessMode mode>
void HeapObjectHeader::Unmark() { … }
bool HeapObjectHeader::TryMarkAtomic() { … }
void HeapObjectHeader::MarkNonAtomic() { … }
template <AccessMode mode>
bool HeapObjectHeader::IsYoung() const { … }
template <AccessMode mode>
bool HeapObjectHeader::IsFree() const { … }
bool HeapObjectHeader::IsFinalizable() const { … }
#if defined(CPPGC_CAGED_HEAP)
void HeapObjectHeader::SetNextUnfinalized(HeapObjectHeader* next) { … }
HeapObjectHeader* HeapObjectHeader::GetNextUnfinalized(
uintptr_t cage_base_or_mask) const { … }
#endif
template <AccessMode mode>
void HeapObjectHeader::Trace(Visitor* visitor) const { … }
template <AccessMode mode, HeapObjectHeader::EncodedHalf part,
std::memory_order memory_order>
uint16_t HeapObjectHeader::LoadEncoded() const { … }
template <AccessMode mode, HeapObjectHeader::EncodedHalf part,
std::memory_order memory_order>
void HeapObjectHeader::StoreEncoded(uint16_t bits, uint16_t mask) { … }
}
}
#endif