5 #ifndef V8_OBJECTS_PROTOTYPE_INFO_INL_H_ 6 #define V8_OBJECTS_PROTOTYPE_INFO_INL_H_ 8 #include "src/objects/prototype-info.h" 10 #include "src/heap/heap-write-barrier-inl.h" 11 #include "src/objects/map.h" 12 #include "src/objects/maybe-object.h" 15 #include "src/objects/object-macros.h" 20 CAST_ACCESSOR(PrototypeInfo)
22 Map PrototypeInfo::ObjectCreateMap() {
23 return Map::cast(object_create_map()->GetHeapObjectAssumeWeak());
27 void PrototypeInfo::SetObjectCreateMap(Handle<PrototypeInfo> info,
29 info->set_object_create_map(HeapObjectReference::Weak(*map));
32 bool PrototypeInfo::HasObjectCreateMap() {
33 MaybeObject cache = object_create_map();
34 return cache->IsWeak();
37 ACCESSORS(PrototypeInfo, module_namespace, Object, kJSModuleNamespaceOffset)
38 ACCESSORS(PrototypeInfo, prototype_users, Object, kPrototypeUsersOffset)
39 WEAK_ACCESSORS(PrototypeInfo, object_create_map, kObjectCreateMapOffset)
40 SMI_ACCESSORS(PrototypeInfo, registry_slot, kRegistrySlotOffset)
41 SMI_ACCESSORS(PrototypeInfo, bit_field, kBitFieldOffset)
42 BOOL_ACCESSORS(PrototypeInfo, bit_field, should_be_fast_map, kShouldBeFastBit)
44 void PrototypeUsers::MarkSlotEmpty(WeakArrayList* array,
int index) {
46 DCHECK_LT(index, array->length());
49 array->Set(index, MaybeObject::FromObject(empty_slot_index(array)));
50 set_empty_slot_index(array, index);
53 Smi PrototypeUsers::empty_slot_index(WeakArrayList* array) {
54 return array->Get(kEmptySlotIndex).ToSmi();
57 void PrototypeUsers::set_empty_slot_index(WeakArrayList* array,
int index) {
58 array->Set(kEmptySlotIndex, MaybeObject::FromObject(Smi::FromInt(index)));
64 #include "src/objects/object-macros-undef.h" 66 #endif // V8_OBJECTS_PROTOTYPE_INFO_INL_H_