/arkcompiler/ets_runtime/ecmascript/ |
H A D | tagged_queue.h | 42 uint32_t capacity = GetCapacity().GetArrayLength(); in Pop() local 43 ASSERT(capacity != 0); in Pop() 44 SetStart(thread, JSTaggedValue((start + 1) % capacity)); in Pop() 51 uint32_t capacity = queue->GetCapacity().GetArrayLength(); in Push() local 52 if (capacity == 0) { in Push() 53 // If there is no capacity, directly create a queue whose capacity is MIN_CAPACITY. Add elements. in Push() 66 if ((end + 1) % capacity == start) { in Push() 68 if (capacity == MAX_QUEUE_INDEX) { in Push() 74 uint32_t newCapacity = capacity in Push() 99 uint32_t capacity = queue->GetCapacity().GetArrayLength(); PushFixedQueue() local 129 uint32_t capacity = GetCapacity().GetArrayLength(); Size() local 163 SetCapacity(const JSThread *thread, JSTaggedValue capacity) SetCapacity() argument 193 Create(JSThread *thread, uint32_t capacity, JSTaggedValue initVal = JSTaggedValue::Hole()) Create() argument [all...] |
H A D | weak_vector.cpp | 21 JSHandle<WeakVector> WeakVector::Create(const JSThread *thread, uint32_t capacity, MemSpaceType type) in Create() argument 23 ASSERT(capacity < MAX_VECTOR_INDEX); in Create() 25 uint32_t length = VectorToArrayIndex(capacity); in Create() 125 uint32_t capacity = vec->GetCapacity(); in Copy() local 126 uint32_t oldLength = VectorToArrayIndex(capacity); in Copy() 128 capacity += DEFAULT_GROW_SIZE; in Copy() 130 uint32_t newLength = VectorToArrayIndex(capacity); in Copy()
|
H A D | linked_hash_table.h | 33 * 1.array[0-2] is used to store common information of hashtale such as numberOfElements and capacity 34 * 2.array[3,3+capacity] is buckets which store the position of entry 35 * 3.array[3+capacity+1,3+capacity + capacity*(entry_size+1)] is the entry stored in order, the last element of an entry 47 // Don't shrink a HashTable below this capacity. 75 int capacity = Capacity(); in HasSufficientCapacity() local 80 if ((nof < capacity) && ((numOfDelElements <= (capacity - nof) / 2))) { // 2: half in HasSufficientCapacity() 82 if (nof + neededFree <= capacity) { in HasSufficientCapacity() 128 int capacity = static_cast<int>(helpers::math::GetPowerOfTwoValue32(rawCap)); ComputeCapacity() local 191 SetCapacity(const JSThread *thread, int capacity) SetCapacity() argument [all...] |
H A D | js_object-inl.h | 347 inline bool JSObject::ShouldTransToDict(uint32_t capacity, uint32_t index) in ShouldTransToDict() argument 349 if (index < capacity) { in ShouldTransToDict() 353 if (index - capacity > MAX_GAP) { in ShouldTransToDict() 361 if (capacity >= MIN_GAP) { in ShouldTransToDict() 362 return index > capacity * FAST_ELEMENTS_FACTOR; in ShouldTransToDict() 369 uint32_t capacity, uint32_t index) in ShouldTransToFastElements() 376 if (static_cast<uint32_t>(dictionary->GetLength()) * SHOULD_TRANS_TO_FAST_ELEMENTS_FACTOR >= capacity || in ShouldTransToFastElements() 368 ShouldTransToFastElements(JSThread *thread, TaggedArray *elements, uint32_t capacity, uint32_t index) ShouldTransToFastElements() argument
|
/arkcompiler/ets_runtime/ecmascript/js_api/ |
H A D | js_api_deque.cpp | 31 uint32_t capacity = elements->GetLength(); in InsertFront() local 34 ASSERT(capacity != 0); in InsertFront() 35 if ((first + capacity - 1) % capacity == last) { in InsertFront() 36 elements = GrowCapacity(thread, deque, capacity, first, last); in InsertFront() 38 deque->SetLast(capacity - 1); in InsertFront() 41 capacity = elements->GetLength(); in InsertFront() 42 ASSERT(capacity != 0); in InsertFront() 43 first = (first + capacity - 1) % capacity; in InsertFront() 52 uint32_t capacity = elements->GetLength(); InsertEnd() local 87 uint32_t capacity = elements->GetLength(); GetTail() local 114 uint32_t capacity = elements->GetLength(); PopFirst() local 130 uint32_t capacity = elements->GetLength(); PopLast() local 148 uint32_t capacity = elements->GetLength(); GetSize() local 173 uint32_t capacity = elements->GetLength(); Set() local 186 uint32_t capacity = elements->GetLength(); Has() local [all...] |
H A D | js_api_deque_iterator.cpp | 50 uint32_t capacity = elements->GetLength(); in Next() local 58 ASSERT(capacity != 0); in Next() 59 iter->SetNextIndex((index + 1) % capacity); in Next() 60 uint32_t elementIndex = (index + capacity - first) % capacity; in Next()
|
H A D | js_api_lightweightset.cpp | 45 uint32_t capacity = hashArray->GetLength(); in Add() local 46 if (size + 1 >= static_cast<int32_t>(capacity)) { in Add() 48 uint32_t newCapacity = capacity << 1U; in Add() 49 hashArray = thread->GetEcmaVM()->GetFactory()->CopyArray(hashArray, capacity, newCapacity); in Add() 50 valueArray = thread->GetEcmaVM()->GetFactory()->CopyArray(valueArray, capacity, newCapacity); in Add() 67 JSHandle<TaggedArray> JSAPILightWeightSet::CreateSlot(const JSThread *thread, const uint32_t capacity) in CreateSlot() argument 69 ASSERT_PRINT(capacity > 0, "size must be a non-negative integer"); in CreateSlot() 71 JSHandle<TaggedArray> taggedArray = factory->NewTaggedArray(capacity); in CreateSlot() 72 for (uint32_t i = 0; i < capacity; i++) { in CreateSlot() 147 uint32_t capacity in EnsureCapacity() local 159 SizeCopy(const JSThread *thread, const JSHandle<JSAPILightWeightSet> &obj, uint32_t capacity, uint32_t newCapacity) SizeCopy() argument 293 uint32_t capacity = TaggedArray::Cast(obj->GetValues().GetTaggedObject())->GetLength(); IncreaseCapacityTo() local [all...] |
H A D | js_api_queue.cpp | 39 uint32_t capacity) in GrowCapacity() 49 newCapacity = ComputeCapacity(capacity); in GrowCapacity() 52 newCapacity = ComputeCapacity(capacity); in GrowCapacity() 112 uint32_t capacity = elements->GetLength(); in Get() local 114 ASSERT(capacity != 0); in Get() 115 uint32_t curIndex = (front + index) % capacity; in Get() 143 uint32_t capacity = elements->GetLength(); in Has() local 150 ASSERT(capacity != 0); in Has() 151 index = (index + 1) % capacity; in Has() 38 GrowCapacity(const JSThread *thread, const JSHandle<JSAPIQueue> &obj, uint32_t capacity) GrowCapacity() argument
|
H A D | js_api_arraylist.cpp | 90 uint32_t capacity = elements->GetLength(); in GetCapacity() local 91 return capacity; in GetCapacity() 95 int capacity) in IncreaseCapacityTo() 101 if (oldElementLength != capacity && length < capacity) { in IncreaseCapacityTo() 104 static_cast<uint32_t>(capacity), static_cast<uint32_t>(length)); in IncreaseCapacityTo() 112 uint32_t capacity = JSAPIArrayList::GetCapacity(thread, arrayList); in TrimToCurrentLength() local 115 if (capacity > length) { in TrimToCurrentLength() 377 uint32_t capacity) in GrowCapacity() 382 if (capacity < oldCapacit in GrowCapacity() 94 IncreaseCapacityTo(JSThread *thread, const JSHandle<JSAPIArrayList> &arrayList, int capacity) IncreaseCapacityTo() argument 376 GrowCapacity(const JSThread *thread, const JSHandle<JSAPIArrayList> &obj, uint32_t capacity) GrowCapacity() argument [all...] |
H A D | js_api_lightweightset.h | 33 static JSHandle<TaggedArray> CreateSlot(const JSThread *thread, const uint32_t capacity); 36 static void SizeCopy(const JSThread *thread, const JSHandle<JSAPILightWeightSet> &obj, uint32_t capacity,
|
/arkcompiler/ets_runtime/ecmascript/mem/ |
H A D | native_area_allocator.cpp | 24 Area *NativeAreaAllocator::AllocateArea(size_t capacity) in AllocateArea() argument 27 if (capacity < headerSize) { // LOCV_EXCL_BR_LINE in AllocateArea() 28 LOG_ECMA_MEM(FATAL) << "capacity must have a size not less than sizeof Area."; in AllocateArea() 31 if (cachedArea_ != nullptr && capacity <= cachedArea_->GetSize()) { in AllocateArea() 37 void *mem = malloc(capacity); in AllocateArea() 39 LOG_ECMA_MEM(FATAL) << "malloc failed, current alloc size = " << capacity in AllocateArea() 44 if (memset_s(mem, capacity, 0, capacity) != EOK) { // LOCV_EXCL_BR_LINE in AllocateArea() 49 IncreaseNativeMemoryUsage(capacity); in AllocateArea() 52 capacity in AllocateArea() [all...] |
H A D | heap_region_allocator.cpp | 24 Region *HeapRegionAllocator::AllocateAlignedRegion(Space *space, size_t capacity, JSThread* thread, BaseHeap *heap, in AllocateAlignedRegion() argument 27 if (capacity == 0) { // LOCV_EXCL_BR_LINE in AllocateAlignedRegion() 28 LOG_ECMA_MEM(FATAL) << "capacity must have a size bigger than 0"; in AllocateAlignedRegion() 39 auto pool = MemMapAllocator::GetInstance()->Allocate(tid, capacity, DEFAULT_REGION_SIZE, in AllocateAlignedRegion() 55 if (memset_s(mapMem, capacity, 0, capacity) != EOK) { // LOCV_EXCL_BR_LINE in AllocateAlignedRegion() 60 IncreaseAnnoMemoryUsage(capacity); in AllocateAlignedRegion() 67 uintptr_t end = mem + capacity; in AllocateAlignedRegion()
|
H A D | native_area_allocator.h | 46 Area *AllocateArea(size_t capacity); 191 static inline Area *AllocateSpace(size_t capacity) in AllocateSpace() argument 194 if (capacity < headerSize) { in AllocateSpace() 195 LOG_ECMA_MEM(FATAL) << "capacity must have a size not less than sizeof Area."; in AllocateSpace() 199 void *mem = malloc(capacity); in AllocateSpace() 206 capacity -= headerSize; in AllocateSpace() 207 return new (mem) Area(begin, capacity); in AllocateSpace()
|
H A D | area.h | 22 Area(uintptr_t begin, size_t capacity) in Area() argument 24 : begin_(begin), end_(begin + capacity), next_(nullptr), prev_(nullptr) in Area()
|
/arkcompiler/ets_runtime/ecmascript/compiler/builtins/ |
H A D | containers_deque_stub_builder.h | 35 GateRef capacity = Load(VariableType::INT32(), elements, IntPtr(TaggedArray::LENGTH_OFFSET));
in GetSize() local 38 return Int32Mod(Int32Add(Int32Sub(last, first), capacity), capacity);
in GetSize() 45 GateRef capacity = Load(VariableType::INT32(), elements, IntPtr(TaggedArray::LENGTH_OFFSET));
in Get() local 47 GateRef curIndex = Int32Mod(Int32Add(first, index), capacity);
in Get()
|
H A D | containers_queue_stub_builder.h | 66 GateRef capacity = Load(VariableType::INT32(), elements, IntPtr(TaggedArray::LENGTH_OFFSET));
in Get() local 68 GateRef curIndex = Int32Mod(Int32Add(front, index), capacity);
in Get()
|
/arkcompiler/runtime_core/libpandabase/tests/ |
H A D | ring_buffer_test.cpp | 28 ASSERT_EQ(buffer.capacity(), DEFAULT_BUFFER_SIZE); in TEST() 32 ASSERT_EQ(buffer.capacity(), DEFAULT_BUFFER_SIZE); in TEST() 82 ASSERT_EQ(buffer.capacity(), DEFAULT_BUFFER_SIZE); in TEST() 105 ASSERT_EQ(buffer.capacity(), DEFAULT_BUFFER_SIZE); in TEST() 114 ASSERT_EQ(buffer.capacity(), DEFAULT_BUFFER_SIZE); in TEST() 129 ASSERT_EQ(buffer.capacity(), DEFAULT_BUFFER_SIZE); in TEST()
|
/arkcompiler/runtime_core/static_core/libpandabase/tests/ |
H A D | ring_buffer_test.cpp | 28 ASSERT_EQ(BUFFER.capacity(), DEFAULT_BUFFER_SIZE); in TEST() 32 ASSERT_EQ(BUFFER.capacity(), DEFAULT_BUFFER_SIZE); in TEST() 82 ASSERT_EQ(buffer.capacity(), DEFAULT_BUFFER_SIZE); in TEST() 105 ASSERT_EQ(buffer.capacity(), DEFAULT_BUFFER_SIZE); in TEST() 114 ASSERT_EQ(buffer.capacity(), DEFAULT_BUFFER_SIZE); in TEST() 129 ASSERT_EQ(buffer.capacity(), DEFAULT_BUFFER_SIZE); in TEST()
|
/arkcompiler/runtime_core/static_core/runtime/mem/gc/g1/ |
H A D | ref_cache_builder.h | 44 if (refVector->size() == refVector->capacity()) { in operator ()() 48 newRefVector->reserve(refVector->capacity() * 2U); in operator ()() 52 ASSERT(refVector->size() < refVector->capacity()); in operator ()()
|
/arkcompiler/ets_runtime/ecmascript/tests/ |
H A D | js_api_arraylist_iterator_test.cpp | 54 uint32_t capacity = JSAPIArrayList::GetCapacity(thread, arrayList); in HWTEST_F_L0() local 55 for (uint32_t i = 0; i < capacity; i++) { in HWTEST_F_L0()
|
H A D | js_api_list_iterator_test.cpp | 65 uint32_t capacity = static_cast<uint32_t>(list->Length()); in HWTEST_F_L0() local 66 for (uint32_t i = 0; i < capacity; i++) { in HWTEST_F_L0()
|
H A D | js_api_linked_list_iterator_test.cpp | 65 uint32_t capacity = static_cast<uint32_t>(linkedList->Length()); in HWTEST_F_L0() local 66 for (uint32_t i = 0; i < capacity; i++) { in HWTEST_F_L0()
|
/arkcompiler/runtime_core/static_core/runtime/mem/refstorage/ |
H A D | reference_storage.cpp | 229 bool ReferenceStorage::PushLocalFrame(uint32_t capacity) in PushLocalFrame() argument 232 size_t needBlocks = (capacity + RefBlock::REFS_IN_BLOCK - 1) / RefBlock::REFS_IN_BLOCK; in PushLocalFrame() 235 LOG(ERROR, GC) << "Free size of local reference storage is less than capacity: " << capacity in PushLocalFrame() 296 bool ReferenceStorage::EnsureLocalCapacity(size_t capacity) in EnsureLocalCapacity() argument 298 size_t needBlocks = (capacity + RefBlock::REFS_IN_BLOCK - 1) / RefBlock::REFS_IN_BLOCK; in EnsureLocalCapacity() 301 LOG(ERROR, GC) << "Can't store size: " << capacity << " in local references"; in EnsureLocalCapacity()
|
H A D | reference_storage.h | 68 * @param capacity minimum number of local references in the frame. 71 PANDA_PUBLIC_API bool PushLocalFrame(uint32_t capacity); 83 * Ensure that capacity in current frame can contain at least `size` references. 84 * @param capacity minimum number of references for this frame 87 bool EnsureLocalCapacity(size_t capacity); 189 * suggest not doing this unless the ReferenceStorage will be out of capacity,
|
/arkcompiler/runtime_core/static_core/plugins/ets/runtime/mem/ |
H A D | ets_reference.h | 135 bool PushLocalEtsFrame(uint32_t capacity) in PushLocalEtsFrame() argument 137 return PushLocalFrame(capacity); in PushLocalEtsFrame()
|