#include "src/objects/js-struct.h"
#include "src/objects/lookup-inl.h"
#include "src/objects/map-inl.h"
#include "src/objects/off-heap-hash-table-inl.h"
#include "src/objects/property-descriptor.h"
namespace v8 {
namespace internal {
namespace {
void PrepareMapCommon(Tagged<Map> map) { … }
}
void AlwaysSharedSpaceJSObject::PrepareMapNoEnumerableProperties(
Tagged<Map> map) { … }
void AlwaysSharedSpaceJSObject::PrepareMapNoEnumerableProperties(
Isolate* isolate, Tagged<Map> map, Tagged<DescriptorArray> descriptors) { … }
void AlwaysSharedSpaceJSObject::PrepareMapWithEnumerableProperties(
Isolate* isolate, DirectHandle<Map> map,
DirectHandle<DescriptorArray> descriptors, int enum_length) { … }
Maybe<bool> AlwaysSharedSpaceJSObject::DefineOwnProperty(
Isolate* isolate, Handle<AlwaysSharedSpaceJSObject> shared_obj,
Handle<Object> key, PropertyDescriptor* desc,
Maybe<ShouldThrow> should_throw) { … }
Maybe<bool> AlwaysSharedSpaceJSObject::HasInstance(
Isolate* isolate, DirectHandle<JSFunction> constructor,
Handle<Object> object) { … }
namespace {
constexpr int kSpecialSlots = …;
InternalIndex GetSpecialSlotIndex(Tagged<Map> instance_map,
Tagged<Symbol> special_slot_name) { … }
template <typename T>
MaybeHandle<T> GetSpecialSlotValue(Isolate* isolate, Tagged<Map> instance_map,
Tagged<Symbol> special_slot_name) { … }
}
Handle<Map> JSSharedStruct::CreateInstanceMap(
Isolate* isolate, const std::vector<Handle<Name>>& field_names,
const std::set<uint32_t>& element_names,
MaybeHandle<String> maybe_registry_key) { … }
MaybeHandle<String> JSSharedStruct::GetRegistryKey(Isolate* isolate,
Tagged<Map> instance_map) { … }
bool JSSharedStruct::IsRegistryKeyDescriptor(Isolate* isolate,
Tagged<Map> instance_map,
InternalIndex i) { … }
MaybeHandle<NumberDictionary> JSSharedStruct::GetElementsTemplate(
Isolate* isolate, Tagged<Map> instance_map) { … }
bool JSSharedStruct::IsElementsTemplateDescriptor(Isolate* isolate,
Tagged<Map> instance_map,
InternalIndex i) { … }
class SharedStructTypeRegistry::Data : public OffHeapHashTableBase<Data> { … };
SharedStructTypeRegistry::SharedStructTypeRegistry()
: … { … }
SharedStructTypeRegistry::~SharedStructTypeRegistry() = default;
MaybeHandle<Map> SharedStructTypeRegistry::CheckIfEntryMatches(
Isolate* isolate, InternalIndex entry, DirectHandle<String> key,
const std::vector<Handle<Name>>& field_names,
const std::set<uint32_t>& element_names) { … }
MaybeHandle<Map> SharedStructTypeRegistry::RegisterNoThrow(
Isolate* isolate, Handle<String> key,
const std::vector<Handle<Name>>& field_names,
const std::set<uint32_t>& element_names) { … }
MaybeHandle<Map> SharedStructTypeRegistry::Register(
Isolate* isolate, Handle<String> key,
const std::vector<Handle<Name>>& field_names,
const std::set<uint32_t>& element_names) { … }
void SharedStructTypeRegistry::IterateElements(Isolate* isolate,
RootVisitor* visitor) { … }
void SharedStructTypeRegistry::NotifyElementsRemoved(int count) { … }
void SharedStructTypeRegistry::EnsureCapacity(PtrComprCageBase cage_base,
int additional_elements) { … }
}
}