5 #ifndef V8_OBJECTS_ORDERED_HASH_TABLE_INL_H_ 6 #define V8_OBJECTS_ORDERED_HASH_TABLE_INL_H_ 8 #include "src/objects/ordered-hash-table.h" 10 #include "src/heap/heap.h" 11 #include "src/objects/fixed-array-inl.h" 14 #include "src/objects/object-macros.h" 19 RootIndex OrderedHashSet::GetMapRootIndex() {
20 return RootIndex::kOrderedHashSetMap;
23 RootIndex OrderedHashMap::GetMapRootIndex() {
24 return RootIndex::kOrderedHashMapMap;
27 RootIndex OrderedNameDictionary::GetMapRootIndex() {
28 return RootIndex::kOrderedNameDictionaryMap;
31 RootIndex SmallOrderedNameDictionary::GetMapRootIndex() {
32 return RootIndex::kSmallOrderedNameDictionaryMap;
35 RootIndex SmallOrderedHashMap::GetMapRootIndex() {
36 return RootIndex::kSmallOrderedHashMapMap;
39 RootIndex SmallOrderedHashSet::GetMapRootIndex() {
40 return RootIndex::kSmallOrderedHashSetMap;
43 inline Object* OrderedHashMap::ValueAt(
int entry) {
44 DCHECK_NE(entry, kNotFound);
45 DCHECK_LT(entry, UsedCapacity());
46 return get(EntryToIndex(entry) + kValueOffset);
49 inline Object* OrderedNameDictionary::ValueAt(
int entry) {
50 DCHECK_NE(entry, kNotFound);
51 DCHECK_LT(entry, UsedCapacity());
52 return get(EntryToIndex(entry) + kValueOffset);
56 inline void OrderedNameDictionary::ValueAtPut(
int entry, Object* value) {
57 DCHECK_NE(entry, kNotFound);
58 DCHECK_LT(entry, UsedCapacity());
59 this->
set(EntryToIndex(entry) + kValueOffset, value);
63 inline PropertyDetails OrderedNameDictionary::DetailsAt(
int entry) {
64 DCHECK_NE(entry, kNotFound);
65 DCHECK_LT(entry, this->UsedCapacity());
67 return PropertyDetails(
68 Smi::cast(
get(EntryToIndex(entry) + kPropertyDetailsOffset)));
71 inline void OrderedNameDictionary::DetailsAtPut(
int entry,
72 PropertyDetails value) {
73 DCHECK_NE(entry, kNotFound);
74 DCHECK_LT(entry, this->UsedCapacity());
76 this->
set(EntryToIndex(entry) + kPropertyDetailsOffset, value.AsSmi());
79 inline Object* SmallOrderedNameDictionary::ValueAt(
int entry) {
80 return this->GetDataEntry(entry, kValueIndex);
84 inline void SmallOrderedNameDictionary::ValueAtPut(
int entry, Object* value) {
85 this->SetDataEntry(entry, kValueIndex, value);
89 inline PropertyDetails SmallOrderedNameDictionary::DetailsAt(
int entry) {
91 return PropertyDetails(
92 Smi::cast(this->GetDataEntry(entry, kPropertyDetailsIndex)));
96 inline void SmallOrderedNameDictionary::DetailsAtPut(
int entry,
97 PropertyDetails value) {
99 this->SetDataEntry(entry, kPropertyDetailsIndex, value.AsSmi());
102 inline bool OrderedHashSet::Is(Handle<HeapObject> table) {
103 return table->IsOrderedHashSet();
106 inline bool OrderedHashMap::Is(Handle<HeapObject> table) {
107 return table->IsOrderedHashMap();
110 inline bool SmallOrderedHashSet::Is(Handle<HeapObject> table) {
111 return table->IsSmallOrderedHashSet();
114 inline bool SmallOrderedHashMap::Is(Handle<HeapObject> table) {
115 return table->IsSmallOrderedHashMap();
120 #include "src/objects/object-macros-undef.h" 122 #endif // V8_OBJECTS_ORDERED_HASH_TABLE_INL_H_