chromium/v8/src/objects/swiss-name-dictionary-inl.h

// Copyright 2021 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_OBJECTS_SWISS_NAME_DICTIONARY_INL_H_
#define V8_OBJECTS_SWISS_NAME_DICTIONARY_INL_H_

#include <algorithm>
#include <optional>

#include "src/base/macros.h"
#include "src/execution/isolate-utils-inl.h"
#include "src/heap/heap.h"
#include "src/objects/fixed-array-inl.h"
#include "src/objects/instance-type-inl.h"
#include "src/objects/js-collection-iterator.h"
#include "src/objects/objects-inl.h"
#include "src/objects/slots-inl.h"
#include "src/objects/smi.h"
#include "src/objects/swiss-name-dictionary.h"

// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"

namespace v8::internal {

#include "torque-generated/src/objects/swiss-name-dictionary-tq-inl.inc"

OBJECT_CONSTRUCTORS_IMPL(SwissNameDictionary, HeapObject)

swiss_table::ctrl_t* SwissNameDictionary::CtrlTable() {}

uint8_t* SwissNameDictionary::PropertyDetailsTable() {}

int SwissNameDictionary::Capacity() {}

void SwissNameDictionary::SetCapacity(int capacity) {}

int SwissNameDictionary::NumberOfElements() {}

int SwissNameDictionary::NumberOfDeletedElements() {}

void SwissNameDictionary::SetNumberOfElements(int elements) {}

void SwissNameDictionary::SetNumberOfDeletedElements(int deleted_elements) {}

int SwissNameDictionary::UsedCapacity() {}

// static
constexpr bool SwissNameDictionary::IsValidCapacity(int capacity) {}

// static
constexpr int SwissNameDictionary::DataTableSize(int capacity) {}

// static
constexpr int SwissNameDictionary::CtrlTableSize(int capacity) {}

// static
constexpr int SwissNameDictionary::SizeFor(int capacity) {}

// We use 7/8th as maximum load factor for non-special cases.
// For 16-wide groups, that gives an average of two empty slots per group.
// Similar to Abseil's CapacityToGrowth.
// static
constexpr int SwissNameDictionary::MaxUsableCapacity(int capacity) {}

// Returns |at_least_space_for| * 8/7 for non-special cases. Similar to Abseil's
// GrowthToLowerboundCapacity.
// static
int SwissNameDictionary::CapacityFor(int at_least_space_for) {}

int SwissNameDictionary::EntryForEnumerationIndex(int enumeration_index) {}

void SwissNameDictionary::SetEntryForEnumerationIndex(int enumeration_index,
                                                      int entry) {}

template <typename IsolateT>
InternalIndex SwissNameDictionary::FindEntry(IsolateT* isolate,
                                             Tagged<Object> key) {}

template <typename IsolateT>
InternalIndex SwissNameDictionary::FindEntry(IsolateT* isolate,
                                             DirectHandle<Object> key) {}

Tagged<Object> SwissNameDictionary::LoadFromDataTable(int entry,
                                                      int data_offset) {}

Tagged<Object> SwissNameDictionary::LoadFromDataTable(
    PtrComprCageBase cage_base, int entry, int data_offset) {}

void SwissNameDictionary::StoreToDataTable(int entry, int data_offset,
                                           Tagged<Object> data) {}

void SwissNameDictionary::StoreToDataTableNoBarrier(int entry, int data_offset,
                                                    Tagged<Object> data) {}

void SwissNameDictionary::ClearDataTableEntry(Isolate* isolate, int entry) {}

void SwissNameDictionary::ValueAtPut(int entry, Tagged<Object> value) {}

void SwissNameDictionary::ValueAtPut(InternalIndex entry,
                                     Tagged<Object> value) {}

void SwissNameDictionary::SetKey(int entry, Tagged<Object> key) {}

void SwissNameDictionary::DetailsAtPut(int entry, PropertyDetails details) {}

void SwissNameDictionary::DetailsAtPut(InternalIndex entry,
                                       PropertyDetails details) {}

Tagged<Object> SwissNameDictionary::KeyAt(int entry) {}

Tagged<Object> SwissNameDictionary::KeyAt(InternalIndex entry) {}

Tagged<Name> SwissNameDictionary::NameAt(InternalIndex entry) {}

// This version can be called on empty buckets.
Tagged<Object> SwissNameDictionary::ValueAtRaw(int entry) {}

Tagged<Object> SwissNameDictionary::ValueAt(InternalIndex entry) {}

std::optional<Tagged<Object>> SwissNameDictionary::TryValueAt(
    InternalIndex entry) {}

PropertyDetails SwissNameDictionary::DetailsAt(int entry) {}

PropertyDetails SwissNameDictionary::DetailsAt(InternalIndex entry) {}

// static
template <typename IsolateT>
Handle<SwissNameDictionary> SwissNameDictionary::EnsureGrowable(
    IsolateT* isolate, Handle<SwissNameDictionary> table) {}

swiss_table::ctrl_t SwissNameDictionary::GetCtrl(int entry) {}

void SwissNameDictionary::SetCtrl(int entry, ctrl_t h) {}

// static
inline int SwissNameDictionary::FindFirstEmpty(uint32_t hash) {}

void SwissNameDictionary::SetMetaTableField(int field_index, int value) {}

int SwissNameDictionary::GetMetaTableField(int field_index) {}

// static
template <typename T>
void SwissNameDictionary::SetMetaTableField(Tagged<ByteArray> meta_table,
                                            int field_index, int value) {}

// static
template <typename T>
int SwissNameDictionary::GetMetaTableField(Tagged<ByteArray> meta_table,
                                           int field_index) {}

constexpr int SwissNameDictionary::MetaTableSizePerEntryFor(int capacity) {}

constexpr int SwissNameDictionary::MetaTableSizeFor(int capacity) {}

bool SwissNameDictionary::IsKey(ReadOnlyRoots roots,
                                Tagged<Object> key_candidate) {}

bool SwissNameDictionary::ToKey(ReadOnlyRoots roots, int entry,
                                Tagged<Object>* out_key) {}

bool SwissNameDictionary::ToKey(ReadOnlyRoots roots, InternalIndex entry,
                                Tagged<Object>* out_key) {}

// static
template <typename IsolateT>
Handle<SwissNameDictionary> SwissNameDictionary::Add(
    IsolateT* isolate, Handle<SwissNameDictionary> original_table,
    DirectHandle<Name> key, DirectHandle<Object> value, PropertyDetails details,
    InternalIndex* entry_out) {}

int SwissNameDictionary::AddInternal(Tagged<Name> key, Tagged<Object> value,
                                     PropertyDetails details) {}

template <typename IsolateT>
void SwissNameDictionary::Initialize(IsolateT* isolate,
                                     Tagged<ByteArray> meta_table,
                                     int capacity) {}

SwissNameDictionary::IndexIterator::IndexIterator(
    Handle<SwissNameDictionary> dict, int start)
    :{}

SwissNameDictionary::IndexIterator&
SwissNameDictionary::IndexIterator::operator++() {}

bool SwissNameDictionary::IndexIterator::operator==(
    const SwissNameDictionary::IndexIterator& b) const {}

bool SwissNameDictionary::IndexIterator::operator!=(
    const IndexIterator& b) const {}

InternalIndex SwissNameDictionary::IndexIterator::operator*() {}

SwissNameDictionary::IndexIterable::IndexIterable(
    Handle<SwissNameDictionary> dict)
    :{}

SwissNameDictionary::IndexIterator SwissNameDictionary::IndexIterable::begin() {}

SwissNameDictionary::IndexIterator SwissNameDictionary::IndexIterable::end() {}

SwissNameDictionary::IndexIterable
SwissNameDictionary::IterateEntriesOrdered() {}

SwissNameDictionary::IndexIterable SwissNameDictionary::IterateEntries() {}

void SwissNameDictionary::SetHash(int32_t hash) {}

int SwissNameDictionary::Hash() {}

// static
constexpr int SwissNameDictionary::MaxCapacity() {}

// static
constexpr int SwissNameDictionary::PrefixOffset() {}

// static
constexpr int SwissNameDictionary::CapacityOffset() {}

// static
constexpr int SwissNameDictionary::MetaTablePointerOffset() {}

// static
constexpr int SwissNameDictionary::DataTableStartOffset() {}

// static
constexpr int SwissNameDictionary::DataTableEndOffset(int capacity) {}

// static
constexpr int SwissNameDictionary::CtrlTableStartOffset(int capacity) {}

// static
constexpr int SwissNameDictionary::PropertyDetailsTableStartOffset(
    int capacity) {}

// static
bool SwissNameDictionary::IsEmpty(ctrl_t c) {}

// static
bool SwissNameDictionary::IsFull(ctrl_t c) {}

// static
bool SwissNameDictionary::IsDeleted(ctrl_t c) {}

// static
bool SwissNameDictionary::IsEmptyOrDeleted(ctrl_t c) {}

// static
swiss_table::ProbeSequence<SwissNameDictionary::kGroupWidth>
SwissNameDictionary::probe(uint32_t hash, int capacity) {}

ACCESSORS_CHECKED2

}  // namespace v8::internal

#include "src/objects/object-macros-undef.h"

#endif  // V8_OBJECTS_SWISS_NAME_DICTIONARY_INL_H_