Lines Matching full:int
28 static int Hash(const JSThread *thread, JSTaggedValue key);
41 static const int MIN_CAPACITY = 4;
42 static const int NUMBER_OF_ELEMENTS_INDEX = 0;
43 static const int NUMBER_OF_DELETED_ELEMENTS_INDEX = 1;
44 static const int CAPACITY_INDEX = 2;
45 static const int NEXT_TABLE_INDEX = 3;
46 static const int ELEMENTS_START_INDEX = 4;
48 static const int MIN_SHRINK_CAPACITY = 16;
50 static JSHandle<Derived> Create(const JSThread *thread, int numberOfElements);
59 int numberOfAddedElements = 1);
64 …static JSHandle<Derived> Shrink(const JSThread *thread, const JSHandle<Derived> &table, int additi…
66 inline bool HasSufficientCapacity(int numOfAddElements) const in HasSufficientCapacity()
68 int numberOfElements = NumberOfElements(); in HasSufficientCapacity()
69 int numOfDelElements = NumberOfDeletedElements(); in HasSufficientCapacity()
70 int capacity = Capacity(); in HasSufficientCapacity()
71 int nof = numberOfElements + numOfAddElements; in HasSufficientCapacity()
76 int neededFree = nof / 2; // 2: half in HasSufficientCapacity()
84 inline int FindElement(const JSThread *thread, JSTaggedValue key) const in FindElement()
89 int hash = LinkedHash::Hash(thread, key); in FindElement()
107 inline void RemoveEntry(const JSThread *thread, int entry) in RemoveEntry()
110 int index = static_cast<int>(EntryToIndex(entry)); in RemoveEntry()
111 for (int i = 0; i < HashObject::ENTRY_SIZE; i++) { in RemoveEntry()
118 inline static int ComputeCapacity(uint32_t atLeastSpaceFor) in ComputeCapacity()
123 int capacity = static_cast<int>(helpers::math::GetPowerOfTwoValue32(rawCap)); in ComputeCapacity()
127 inline static int ComputeCapacityWithShrink(int currentCapacity, int atLeastSpaceFor) in ComputeCapacityWithShrink()
135 int newCapacity = ComputeCapacity(atLeastSpaceFor); in ComputeCapacityWithShrink()
144 inline int NumberOfElements() const in NumberOfElements()
149 inline int NumberOfDeletedElements() const in NumberOfDeletedElements()
154 inline int Capacity() const in Capacity()
159 inline JSTaggedValue GetKey(int entry) const in GetKey()
161 int index = static_cast<int>(EntryToIndex(entry)); in GetKey()
165 inline JSTaggedValue GetValue(int entry) const in GetValue()
167 int index = static_cast<int>(EntryToIndex(entry)) + HashObject::ENTRY_VALUE_INDEX; in GetValue()
176 inline void SetNumberOfElements(const JSThread *thread, int nof) in SetNumberOfElements()
181 inline void SetNumberOfDeletedElements(const JSThread *thread, int nod) in SetNumberOfDeletedElements()
186 inline void SetCapacity(const JSThread *thread, int capacity) in SetCapacity()
201 inline int GetDeletedElementsAt(int entry) const in GetDeletedElementsAt()
204 int currentEntry = entry - 1; in GetDeletedElementsAt()
221 int numberOfAllElements = NumberOfElements() + NumberOfDeletedElements(); in Rehash()
222 int desEntry = 0; in Rehash()
223 int currentDeletedElements = 0; in Rehash()
225 for (int i = 0; i < numberOfAllElements; i++) { in Rehash()
226 int fromIndex = static_cast<int>(EntryToIndex(i)); in Rehash()
240 int bucket = static_cast<int>(newTable->HashToBucket(LinkedHash::Hash(thread, key))); in Rehash()
242 int desIndex = static_cast<int>(newTable->EntryToIndex(desEntry)); in Rehash()
243 for (int j = 0; j < HashObject::ENTRY_SIZE; j++) { in Rehash()
253 inline JSTaggedValue GetElement(int index) const in GetElement()
255 ASSERT(index >= 0 && index < static_cast<int>(GetLength())); in GetElement()
259 inline void SetElement(const JSThread *thread, int index, JSTaggedValue element) in SetElement()
261 ASSERT(index >= 0 && index < static_cast<int>(GetLength())); in SetElement()
265 inline void SetKey(const JSThread *thread, int entry, JSTaggedValue key) in SetKey()
267 int index = static_cast<int>(EntryToIndex(entry)); in SetKey()
271 inline void SetValue(const JSThread *thread, int entry, JSTaggedValue value) in SetValue()
273 int index = static_cast<int>(EntryToIndex(entry)) + HashObject::ENTRY_VALUE_INDEX; in SetValue()
277 inline JSTaggedValue GetNextEntry(int entry) const in GetNextEntry()
279 int index = static_cast<int>(EntryToIndex(entry)) + HashObject::ENTRY_SIZE; in GetNextEntry()
283 inline void SetNextEntry(const JSThread *thread, int entry, JSTaggedValue nextEntry) in SetNextEntry()
285 int index = static_cast<int>(EntryToIndex(entry)) + HashObject::ENTRY_SIZE; in SetNextEntry()
302 … return ELEMENTS_START_INDEX + Capacity() + static_cast<int>(entry) * (HashObject::ENTRY_SIZE + 1); in EntryToIndex()
305 inline void InsertNewEntry(const JSThread *thread, int bucket, int entry) in InsertNewEntry()
307 int bucketIndex = static_cast<int>(BucketToIndex(bucket)); in InsertNewEntry()
313 inline int GetDeletedNum(int entry) const in GetDeletedNum()
319 inline void SetDeletedNum(const JSThread *thread, int entry, JSTaggedValue num) in SetDeletedNum()
334 static const int ENTRY_SIZE = 2;
335 static const int ENTRY_VALUE_INDEX = 1;
344 …static JSHandle<LinkedHashMap> Create(const JSThread *thread, int numberOfElements = MIN_CAPACITY);
358 int additionalCapacity = 0);
374 static const int ENTRY_SIZE = 1;
375 static const int ENTRY_VALUE_INDEX = 0;
384 …static JSHandle<LinkedHashSet> Create(const JSThread *thread, int numberOfElements = MIN_CAPACITY);
396 int additionalCapacity = 0);