• Home
  • Raw
  • Download

Lines Matching full:int

28     static int Hash(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(JSTaggedValue key) const in FindElement()
89 int hash = LinkedHash::Hash(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()
218 int numberOfAllElements = NumberOfElements() + NumberOfDeletedElements(); in Rehash()
219 int desEntry = 0; in Rehash()
220 int currentDeletedElements = 0; in Rehash()
222 for (int i = 0; i < numberOfAllElements; i++) { in Rehash()
223 int fromIndex = static_cast<int>(EntryToIndex(i)); in Rehash()
237 int bucket = static_cast<int>(newTable->HashToBucket(LinkedHash::Hash(key))); in Rehash()
239 int desIndex = static_cast<int>(newTable->EntryToIndex(desEntry)); in Rehash()
240 for (int j = 0; j < HashObject::ENTRY_SIZE; j++) { in Rehash()
250 inline JSTaggedValue GetElement(int index) const in GetElement()
252 ASSERT(index >= 0 && index < static_cast<int>(GetLength())); in GetElement()
256 inline void SetElement(const JSThread *thread, int index, JSTaggedValue element) in SetElement()
258 ASSERT(index >= 0 && index < static_cast<int>(GetLength())); in SetElement()
262 inline void SetKey(const JSThread *thread, int entry, JSTaggedValue key) in SetKey()
264 int index = static_cast<int>(EntryToIndex(entry)); in SetKey()
268 inline void SetValue(const JSThread *thread, int entry, JSTaggedValue value) in SetValue()
270 int index = static_cast<int>(EntryToIndex(entry)) + HashObject::ENTRY_VALUE_INDEX; in SetValue()
274 inline JSTaggedValue GetNextEntry(int entry) const in GetNextEntry()
276 int index = static_cast<int>(EntryToIndex(entry)) + HashObject::ENTRY_SIZE; in GetNextEntry()
280 inline void SetNextEntry(const JSThread *thread, int entry, JSTaggedValue nextEntry) in SetNextEntry()
282 int index = static_cast<int>(EntryToIndex(entry)) + HashObject::ENTRY_SIZE; in SetNextEntry()
299 … return ELEMENTS_START_INDEX + Capacity() + static_cast<int>(entry) * (HashObject::ENTRY_SIZE + 1); in EntryToIndex()
302 inline void InsertNewEntry(const JSThread *thread, int bucket, int entry) in InsertNewEntry()
304 int bucketIndex = static_cast<int>(BucketToIndex(bucket)); in InsertNewEntry()
310 inline int GetDeletedNum(int entry) const in GetDeletedNum()
316 inline void SetDeletedNum(const JSThread *thread, int entry, JSTaggedValue num) in SetDeletedNum()
331 static const int ENTRY_SIZE = 2;
332 static const int ENTRY_VALUE_INDEX = 1;
341 …static JSHandle<LinkedHashMap> Create(const JSThread *thread, int numberOfElements = MIN_CAPACITY);
355 int additionalCapacity = 0);
371 static const int ENTRY_SIZE = 1;
372 static const int ENTRY_VALUE_INDEX = 0;
381 …static JSHandle<LinkedHashSet> Create(const JSThread *thread, int numberOfElements = MIN_CAPACITY);
393 int additionalCapacity = 0);