Lines Matching refs:table
30 JSHandle<Derived> table;
32 table = JSHandle<Derived>(factory->NewSOldSpaceTaggedArray(length));
34 table = JSHandle<Derived>(factory->NewTaggedArray(length));
36 table->SetNumberOfElements(thread, 0);
37 table->SetNumberOfDeletedElements(thread, 0);
38 table->SetCapacity(thread, capacity);
39 return table;
43 JSHandle<Derived> LinkedHashTable<Derived, HashObject>::Insert(const JSThread *thread, const JSHandle<Derived> &table,
49 int entry = table->FindElement(thread, key.GetTaggedValue());
51 table->SetValue(thread, entry, value.GetTaggedValue());
52 return table;
55 JSHandle<Derived> newTable = GrowCapacity(thread, table);
69 const JSHandle<Derived> &table, const JSHandle<JSTaggedValue> &key, const JSHandle<JSTaggedValue> &value)
74 int entry = table->FindElement(thread, key.GetTaggedValue());
76 table->SetValue(thread, entry, value.GetTaggedValue());
77 return table;
80 JSHandle<Derived> newTable = GrowCapacity(thread, table);
98 const JSHandle<Derived> &table, int numberOfAddedElements)
100 if (table->HasSufficientCapacity(numberOfAddedElements)) {
101 return table;
103 int newCapacity = ComputeCapacity(table->NumberOfElements() + numberOfAddedElements);
105 table.GetTaggedValue().IsInSharedHeap() ? MemSpaceKind::SHARED : MemSpaceKind::LOCAL);
106 table->Rehash(thread, *newTable);
111 JSHandle<Derived> LinkedHashTable<Derived, HashObject>::Remove(const JSThread *thread, const JSHandle<Derived> &table,
114 int entry = table->FindElement(thread, key.GetTaggedValue());
116 return table;
119 table->RemoveEntry(thread, entry);
120 return Shrink(thread, table);
124 JSHandle<Derived> LinkedHashTable<Derived, HashObject>::Shrink(const JSThread *thread, const JSHandle<Derived> &table,
127 int newCapacity = ComputeCapacityWithShrink(table->Capacity(), table->NumberOfElements() + additionalCapacity);
128 if (newCapacity == table->Capacity()) {
129 return table;
133 table.GetTaggedValue().IsInSharedHeap() ? MemSpaceKind::SHARED : MemSpaceKind::LOCAL);
135 table->Rehash(thread, *newTable);
178 JSHandle<LinkedHashMap> LinkedHashMap::Clear(const JSThread *thread, const JSHandle<LinkedHashMap> &table)
180 if (table->Capacity() == LinkedHashMap::MIN_CAPACITY) {
181 table->FillRangeWithSpecialValue(JSTaggedValue::Hole(), LinkedHashMap::ELEMENTS_START_INDEX,
182 table->GetLength());
183 table->SetNumberOfDeletedElements(thread, table->NumberOfDeletedElements() + table->NumberOfElements());
184 table->SetNumberOfElements(thread, 0);
185 return table;
188 table.GetTaggedValue().IsInSharedHeap() ? MemSpaceKind::SHARED : MemSpaceKind::LOCAL);
189 if (table->Capacity() > 0) {
190 table->SetNextTable(thread, newMap.GetTaggedValue());
191 table->SetNumberOfDeletedElements(thread, -1);
196 JSHandle<LinkedHashMap> LinkedHashMap::Shrink(const JSThread *thread, const JSHandle<LinkedHashMap> &table,
199 return LinkedHashTable<LinkedHashMap, LinkedHashMapObject>::Shrink(thread, table, additionalCapacity);
232 JSHandle<LinkedHashSet> LinkedHashSet::Clear(const JSThread *thread, const JSHandle<LinkedHashSet> &table)
234 if (table->Capacity() == LinkedHashSet::MIN_CAPACITY) {
235 table->FillRangeWithSpecialValue(JSTaggedValue::Hole(), LinkedHashSet::ELEMENTS_START_INDEX,
236 table->GetLength());
237 table->SetNumberOfDeletedElements(thread, table->NumberOfDeletedElements() + table->NumberOfElements());
238 table->SetNumberOfElements(thread, 0);
239 return table;
242 table.GetTaggedValue().IsInSharedHeap() ? MemSpaceKind::SHARED : MemSpaceKind::LOCAL);
243 if (table->Capacity() > 0) {
244 table->SetNextTable(thread, newSet.GetTaggedValue());
245 table->SetNumberOfDeletedElements(thread, -1);
250 JSHandle<LinkedHashSet> LinkedHashSet::Shrink(const JSThread *thread, const JSHandle<LinkedHashSet> &table,
253 return LinkedHashTable<LinkedHashSet, LinkedHashSetObject>::Shrink(thread, table, additionalCapacity);