#include "src/objects/string-forwarding-table.h"
#include "src/base/atomicops.h"
#include "src/common/globals.h"
#include "src/objects/objects-inl.h"
#include "src/objects/slots-inl.h"
#include "src/objects/slots.h"
#include "src/objects/string-forwarding-table-inl.h"
#include "src/utils/allocation.h"
namespace v8 {
namespace internal {
StringForwardingTable::Block::Block(int capacity) : … { … }
void* StringForwardingTable::Block::operator new(size_t size, int capacity) { … }
void StringForwardingTable::Block::operator delete(void* block) { … }
std::unique_ptr<StringForwardingTable::Block> StringForwardingTable::Block::New(
int capacity) { … }
void StringForwardingTable::Block::UpdateAfterYoungEvacuation(
PtrComprCageBase cage_base) { … }
void StringForwardingTable::Block::UpdateAfterFullEvacuation(
PtrComprCageBase cage_base) { … }
namespace {
bool UpdateForwardedSlot(Tagged<HeapObject> object, OffHeapObjectSlot slot) { … }
bool UpdateForwardedSlot(Tagged<Object> object, OffHeapObjectSlot slot) { … }
}
void StringForwardingTable::Block::UpdateAfterYoungEvacuation(
PtrComprCageBase cage_base, int up_to_index) { … }
void StringForwardingTable::Block::UpdateAfterFullEvacuation(
PtrComprCageBase cage_base, int up_to_index) { … }
StringForwardingTable::BlockVector::BlockVector(size_t capacity)
: … { … }
StringForwardingTable::BlockVector::~BlockVector() { … }
std::unique_ptr<StringForwardingTable::BlockVector>
StringForwardingTable::BlockVector::Grow(
StringForwardingTable::BlockVector* data, size_t capacity,
const base::Mutex& mutex) { … }
StringForwardingTable::StringForwardingTable(Isolate* isolate)
: … { … }
StringForwardingTable::~StringForwardingTable() { … }
void StringForwardingTable::InitializeBlockVector() { … }
StringForwardingTable::BlockVector* StringForwardingTable::EnsureCapacity(
uint32_t block_index) { … }
int StringForwardingTable::AddForwardString(Tagged<String> string,
Tagged<String> forward_to) { … }
void StringForwardingTable::UpdateForwardString(int index,
Tagged<String> forward_to) { … }
template <typename T>
int StringForwardingTable::AddExternalResourceAndHash(Tagged<String> string,
T* resource,
uint32_t raw_hash) { … }
template EXPORT_TEMPLATE_DEFINE(…) int StringForwardingTable::
AddExternalResourceAndHash(Tagged<String> string,
v8::String::ExternalOneByteStringResource*,
uint32_t raw_hash);
template EXPORT_TEMPLATE_DEFINE(…) int StringForwardingTable::
AddExternalResourceAndHash(Tagged<String> string,
v8::String::ExternalStringResource*,
uint32_t raw_hash);
template <typename T>
bool StringForwardingTable::TryUpdateExternalResource(int index, T* resource) { … }
template EXPORT_TEMPLATE_DEFINE(…) bool StringForwardingTable::
TryUpdateExternalResource(
int index, v8::String::ExternalOneByteStringResource* resource);
template EXPORT_TEMPLATE_DEFINE(…) bool StringForwardingTable::
TryUpdateExternalResource(int index,
v8::String::ExternalStringResource* resource);
Tagged<String> StringForwardingTable::GetForwardString(
PtrComprCageBase cage_base, int index) const { … }
Address StringForwardingTable::GetForwardStringAddress(Isolate* isolate,
int index) { … }
uint32_t StringForwardingTable::GetRawHash(PtrComprCageBase cage_base,
int index) const { … }
uint32_t StringForwardingTable::GetRawHashStatic(Isolate* isolate, int index) { … }
v8::String::ExternalStringResourceBase*
StringForwardingTable::GetExternalResource(int index, bool* is_one_byte) const { … }
void StringForwardingTable::TearDown() { … }
void StringForwardingTable::Reset() { … }
void StringForwardingTable::UpdateAfterYoungEvacuation() { … }
void StringForwardingTable::UpdateAfterFullEvacuation() { … }
}
}