/arkcompiler/ets_runtime/ecmascript/js_api/ |
D | js_api_deque.cpp | 37 uint32_t capacity = elements->GetLength(); in InsertFront() local 40 ASSERT(capacity != 0); in InsertFront() 41 if ((first + capacity - 1) % capacity == last) { in InsertFront() 42 elements = GrowCapacity(thread, deque, capacity, first, last); in InsertFront() 44 deque->SetLast(capacity - 1); in InsertFront() 47 capacity = elements->GetLength(); in InsertFront() 48 ASSERT(capacity != 0); in InsertFront() 49 first = (first + capacity - 1) % capacity; in InsertFront() 58 uint32_t capacity = elements->GetLength(); in InsertEnd() local 61 ASSERT(capacity != 0); in InsertEnd() [all …]
|
D | js_api_deque_iterator.cpp | 56 uint32_t capacity = elements->GetLength(); in Next() local 64 ASSERT(capacity != 0); in Next() 65 iter->SetNextIndex((index + 1) % capacity); in Next() 66 uint32_t elementIndex = (index + capacity - first) % capacity; in Next()
|
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 …andle<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 = hashes->GetLength(); in EnsureCapacity() local [all …]
|
D | js_api_queue.cpp | 44 uint32_t capacity) in GrowCapacity() argument 54 newCapacity = ComputeCapacity(capacity); in GrowCapacity() 57 newCapacity = ComputeCapacity(capacity); in GrowCapacity() 116 uint32_t capacity = elements->GetLength(); in Get() local 118 ASSERT(capacity != 0); in Get() 119 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()
|
D | js_api_arraylist.cpp | 95 uint32_t capacity = elements->GetLength(); in GetCapacity() local 96 return capacity; in GetCapacity() 100 int capacity) in IncreaseCapacityTo() argument 106 if (oldElementLength != capacity && length < capacity) { in IncreaseCapacityTo() 109 static_cast<uint32_t>(capacity), static_cast<uint32_t>(length)); in IncreaseCapacityTo() 117 uint32_t capacity = JSAPIArrayList::GetCapacity(thread, arrayList); in TrimToCurrentLength() local 120 if (capacity > length) { in TrimToCurrentLength() 360 uint32_t capacity) in GrowCapacity() argument 365 if (capacity < oldCapacity) { in GrowCapacity() 368 uint32_t newCapacity = ComputeCapacity(capacity); in GrowCapacity()
|
D | js_api_plain_array.cpp | 45 uint32_t capacity = valueArray->GetLength(); in Add() local 46 if (size + 1 >= capacity) { in Add() 47 uint32_t newCapacity = capacity << 1U; in Add() 49 thread->GetEcmaVM()->GetFactory()->CopyArray(keyArray, capacity, newCapacity); in Add() 51 thread->GetEcmaVM()->GetFactory()->CopyArray(valueArray, capacity, newCapacity); in Add() 61 JSHandle<TaggedArray> JSAPIPlainArray::CreateSlot(const JSThread *thread, const uint32_t capacity) in CreateSlot() argument 63 ASSERT_PRINT(capacity > 0, "size must be a non-negative integer"); in CreateSlot() 65 JSHandle<TaggedArray> taggedArray = factory->NewTaggedArray(capacity, JSTaggedValue::Hole()); in CreateSlot()
|
D | js_api_stack.cpp | 83 uint32_t capacity) in GrowCapacity() argument 87 if (capacity < oldLength) { in GrowCapacity() 90 uint32_t newCapacity = ComputeCapacity(capacity); in GrowCapacity()
|
D | js_api_lightweightset.h | 33 static JSHandle<TaggedArray> CreateSlot(const JSThread *thread, const uint32_t capacity); 36 … void SizeCopy(const JSThread *thread, const JSHandle<JSAPILightWeightSet> &obj, uint32_t capacity,
|
/arkcompiler/ets_runtime/ecmascript/ |
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() 66 if ((end + 1) % capacity == start) { in Push() 68 if (capacity == MAX_QUEUE_INDEX) { in Push() 74 uint32_t newCapacity = capacity + (capacity >> 1U); in Push() 75 newCapacity = newCapacity < capacity ? MAX_QUEUE_INDEX : newCapacity; in Push() 78 for (uint32_t i = start; newEnd < size; i = (i + 1) % capacity) { in Push() [all …]
|
D | weak_vector.cpp | 21 JSHandle<WeakVector> WeakVector::Create(const JSThread *thread, uint32_t capacity) in Create() argument 23 ASSERT(capacity < MAX_VECTOR_INDEX); in Create() 25 uint32_t length = VectorToArrayIndex(capacity); in Create() 119 uint32_t capacity = vec->GetCapacity(); in Copy() local 120 uint32_t oldLength = VectorToArrayIndex(capacity); in Copy() 122 capacity += DEFAULT_GROW_SIZE; in Copy() 124 uint32_t newLength = VectorToArrayIndex(capacity); in Copy()
|
D | linked_hash_table.h | 70 int capacity = Capacity(); in HasSufficientCapacity() local 75 if ((nof < capacity) && ((numOfDelElements <= (capacity - nof) / 2))) { // 2: half in HasSufficientCapacity() 77 if (nof + neededFree <= capacity) { in HasSufficientCapacity() 123 int capacity = static_cast<int>(helpers::math::GetPowerOfTwoValue32(rawCap)); in ComputeCapacity() local 124 return (capacity > MIN_CAPACITY) ? capacity : MIN_CAPACITY; in ComputeCapacity() 186 inline void SetCapacity(const JSThread *thread, int capacity) in SetCapacity() argument 188 Set(thread, CAPACITY_INDEX, JSTaggedValue(capacity)); in SetCapacity()
|
D | js_object-inl.h | 327 inline bool JSObject::ShouldTransToDict(uint32_t capacity, uint32_t index) in ShouldTransToDict() argument 329 if (index < capacity) { in ShouldTransToDict() 333 if (index - capacity > MAX_GAP) { in ShouldTransToDict() 341 if (capacity >= MIN_GAP) { in ShouldTransToDict() 342 return index > capacity * FAST_ELEMENTS_FACTOR; in ShouldTransToDict()
|
/arkcompiler/ets_runtime/ecmascript/mem/ |
D | native_area_allocator.cpp | 22 Area *NativeAreaAllocator::AllocateArea(size_t capacity) in AllocateArea() argument 25 if (capacity < headerSize) { in AllocateArea() 29 if (cachedArea_ != nullptr && capacity <= cachedArea_->GetSize()) { in AllocateArea() 35 void *mem = malloc(capacity); in AllocateArea() 37 LOG_ECMA_MEM(FATAL) << "malloc failed, current alloc size = " << capacity in AllocateArea() 42 if (memset_s(mem, capacity, 0, capacity) != EOK) { in AllocateArea() 47 IncreaseNativeMemoryUsage(capacity); in AllocateArea() 50 capacity -= headerSize; in AllocateArea() 51 return new (mem) Area(begin, capacity); in AllocateArea()
|
D | heap_region_allocator.cpp | 27 Region *HeapRegionAllocator::AllocateAlignedRegion(Space *space, size_t capacity, JSThread* thread) in AllocateAlignedRegion() argument 29 if (capacity == 0) { in AllocateAlignedRegion() 36 …auto pool = MemMapAllocator::GetInstance()->Allocate(capacity, DEFAULT_REGION_SIZE, isRegular, isM… in AllocateAlignedRegion() 43 if (memset_s(mapMem, capacity, 0, capacity) != EOK) { in AllocateAlignedRegion() 48 IncreaseAnnoMemoryUsage(capacity); in AllocateAlignedRegion() 56 uintptr_t end = mem + capacity; in AllocateAlignedRegion()
|
D | native_area_allocator.h | 39 Area *AllocateArea(size_t capacity); 121 static inline Area *AllocateSpace(size_t capacity) in AllocateSpace() argument 124 if (capacity < headerSize) { in AllocateSpace() 129 void *mem = malloc(capacity); in AllocateSpace() 136 capacity -= headerSize; in AllocateSpace() 137 return new (mem) Area(begin, capacity); in AllocateSpace()
|
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/ |
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()
|
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/ |
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/ets_runtime/ecmascript/ts_types/ |
D | ts_type_table.cpp | 37 uint32_t capacity = table->GetLength(); // can't be 0 due to RESERVE_TABLE_LENGTH in PushBackTypeToTable() local 39 if (UNLIKELY(capacity <= numberOfTypes + RESERVE_TABLE_LENGTH)) { in PushBackTypeToTable() 41 capacity * INCREASE_CAPACITY_RATE)); in PushBackTypeToTable()
|
/arkcompiler/ets_runtime/ecmascript/ic/ |
D | ic_runtime_stub-inl.h | 291 int capacity = static_cast<int>(array->GetLength()); in StoreWithTransition() local 293 if (index >= capacity) { in StoreWithTransition() 299 if (capacity == 0) { in StoreWithTransition() 300 capacity = JSObject::MIN_PROPERTIES_LENGTH; in StoreWithTransition() 301 properties = factory->NewTaggedArray(capacity); in StoreWithTransition() 304 properties = factory->CopyArray(arrayHandle, capacity, in StoreWithTransition() 305 JSObject::ComputePropertyCapacity(capacity)); in StoreWithTransition() 464 uint32_t capacity = elements->GetLength(); in StoreElement() local 465 if (elementIndex >= capacity) { in StoreElement() 466 if (JSObject::ShouldTransToDict(capacity, elementIndex)) { in StoreElement()
|
/arkcompiler/ets_runtime/ecmascript/tests/ |
D | js_api_linked_list_iterator_test.cpp | 111 uint32_t capacity = static_cast<uint32_t>(linkedList->Length()); in HWTEST_F_L0() local 112 for (uint32_t i = 0; i < capacity; i++) { in HWTEST_F_L0()
|
D | js_api_arraylist_iterator_test.cpp | 101 uint32_t capacity = JSAPIArrayList::GetCapacity(thread, arrayList); in HWTEST_F_L0() local 102 for (uint32_t i = 0; i < capacity; i++) { in HWTEST_F_L0()
|
D | js_api_list_iterator_test.cpp | 111 uint32_t capacity = static_cast<uint32_t>(list->Length()); in HWTEST_F_L0() local 112 for (uint32_t i = 0; i < capacity; i++) { in HWTEST_F_L0()
|
/arkcompiler/ets_runtime/ecmascript/compiler/aot_file/ |
D | aot_file_manager.h | 64 …inline void InitializeWithSpecialValue(JSTaggedValue initValue, uint32_t capacity, uint32_t extraL… 66 TaggedArray::InitializeWithSpecialValue(initValue, capacity + RESERVED_LENGTH, extraLength);
|