/arkcompiler/runtime_core/static_core/libpandabase/utils/ |
D | bit_memory_stream.h | 33 void EnsureSpace(size_t length) in EnsureSpace() argument 35 data_->resize(RoundUp(BitsToBytesRoundUp(offset_ + length), sizeof(uint32_t))); in EnsureSpace() 38 void Write(size_t value, size_t length) in Write() argument 40 if (length != 0) { in Write() 41 ASSERT(length <= (sizeof(value) * BITS_PER_BYTE)); in Write() 42 EnsureSpace(length); in Write() 43 BitMemoryRegion region(data_->data(), offset_, length); in Write() 44 region.Write(value, 0, length); in Write() 45 offset_ += length; in Write() 49 void Write(uint32_t *ptr, size_t payloadLength, size_t length) in Write() argument [all …]
|
D | bit_memory_region.h | 162 Read(size_t offset, size_t length) const in Read() argument 167 if (length == 0) { in Read() 171 ASSERT(offset + length <= size_); in Read() 181 T extra = data[index + (shift + (length - 1)) / width]; in Read() 182 T clear = (std::numeric_limits<T>::max() << 1U) << (length - 1); in Read() 203 T Pop(size_t length) in Pop() argument 205 T res = Read(0, length); in Pop() 206 start_ += length; in Pop() 211 void Write(uint32_t value, size_t offset, size_t length) in Write() argument 213 if (length == 0) { in Write() [all …]
|
/arkcompiler/runtime_core/libpandabase/utils/ |
D | bit_memory_stream.h | 33 void EnsureSpace(size_t length) in EnsureSpace() argument 35 data_->resize(RoundUp(BitsToBytesRoundUp(offset_ + length), sizeof(uint32_t))); in EnsureSpace() 38 void Write(size_t value, size_t length) in Write() argument 40 if (length != 0) { in Write() 41 ASSERT(length <= (sizeof(value) * BITS_PER_BYTE)); in Write() 42 EnsureSpace(length); in Write() 43 BitMemoryRegion region(data_->data(), offset_, length); in Write() 44 region.Write(value, 0, length); in Write() 45 offset_ += length; in Write() 49 void Write(uint32_t *ptr, size_t payload_length, size_t length) in Write() argument [all …]
|
D | bit_memory_region.h | 152 Read(size_t offset, size_t length) const in Read() argument 157 if (length == 0) { in Read() 161 ASSERT(offset + length <= size_); in Read() 171 T extra = data[index + (shift + (length - 1)) / width]; in Read() 172 T clear = (std::numeric_limits<T>::max() << 1U) << (length - 1); in Read() 193 T Pop(size_t length) in Pop() argument 195 T res = Read(0, length); in Pop() 196 start_ += length; in Pop() 201 void Write(uint32_t value, size_t offset, size_t length) in Write() argument 203 if (length == 0) { in Write() [all …]
|
/arkcompiler/ets_runtime/test/aottest/typedarrayfill/ |
D | typedarrayfill.ts | 17 let length = 10000; 18 let arr = new Int8Array(length) 33 for (let i = end; i < length; i++) { 46 let length = 10000; 47 let arr = new Uint8ClampedArray(length) 62 for (let i = end; i < length; i++) { 75 let length = 10000; 76 let arr = new Int8Array(length) 91 for (let i = end; i < length; i++) { 104 let length = 10000; [all …]
|
/arkcompiler/ets_runtime/test/moduletest/array/ |
D | array.js | 24 print(a.length); 33 print(arr2.length); 38 print(arr3.length); 43 print(arr4.length); 48 print(arr4.length); 54 print(arr5.length); 76 print(arr9.length); // 9 78 print(arr9.length); // 0 79 for(let i = 0; i < arr9.length; i++) { 84 print(arr10.length); // 9 [all …]
|
/arkcompiler/runtime_core/static_core/plugins/ets/tests/mock/ |
D | array_native_test.cpp | 77 ets_size length = env_->GetArrayLength(array); in TEST_F() local 78 ASSERT_EQ(length, src.size()); in TEST_F() 85 std::vector<ets_boolean> res1 = {buf, buf + length}; in TEST_F() 96 std::vector<ets_boolean> vec(length); in TEST_F() 97 env_->GetBooleanArrayRegion(array, 0, length, vec.data()); in TEST_F() 102 ets_size half = length / 2; in TEST_F() 103 std::vector<ets_boolean> vec(length - half); in TEST_F() 104 env_->GetBooleanArrayRegion(array, half, length - half, vec.data()); in TEST_F() 116 ets_size length = env_->GetArrayLength(array); in TEST_F() local 117 ASSERT_EQ(length, src.size()); in TEST_F() [all …]
|
/arkcompiler/runtime_core/static_core/runtime/coretypes/ |
D | array.cpp | 27 static Array *AllocateArray(panda::BaseClass *arrayClass, size_t elemSize, ArraySizeT length, in AllocateArray() argument 30 size_t size = Array::ComputeSize(elemSize, length); in AllocateArray() 32 …ERROR, RUNTIME) << "Illegal array size: element size: " << elemSize << " array length: " << length; in AllocateArray() 48 Array *Array::Create(panda::Class *arrayClass, const uint8_t *data, ArraySizeT length, panda::Space… in Create() argument 51 auto *array = AllocateArray(arrayClass, elemSize, length, spaceType); in Create() 59 array->SetLength(length); in Create() 60 std::copy_n(data, length * elemSize, reinterpret_cast<uint8_t *>(array->GetData())); in Create() 69 Array *Array::Create(panda::Class *arrayClass, ArraySizeT length, panda::SpaceType spaceType) in Create() argument 72 auto *array = AllocateArray(arrayClass, elemSize, length, spaceType); in Create() 78 array->SetLength(length); in Create() [all …]
|
/arkcompiler/ets_runtime/ecmascript/js_api/ |
D | js_api_arraylist.cpp | 34 uint32_t length = arrayList->GetLength().GetArrayLength(); in Add() local 35 JSHandle<TaggedArray> elements = GrowCapacity(thread, arrayList, length + 1); in Add() 38 elements->Set(thread, length, value); in Add() 39 arrayList->SetLength(thread, JSTaggedValue(++length)); in Add() 46 int length = arrayList->GetLength().GetInt(); in Insert() local 47 if (index < 0 || index > length) { in Insert() 49 oss << "The value of \"index\" is out of range. It must be >= 0 && <= " << length in Insert() 54 JSHandle<TaggedArray> elements = GrowCapacity(thread, arrayList, length + 1); in Insert() 56 for (int i = length - 1; i >= index; --i) { in Insert() 60 arrayList->SetLength(thread, JSTaggedValue(++length)); in Insert() [all …]
|
D | js_api_vector.cpp | 33 uint32_t length = vector->GetSize(); in Add() local 34 GrowCapacity(thread, vector, length + 1); in Add() 38 elements->Set(thread, length, value); in Add() 39 vector->SetLength(++length); in Add() 47 uint32_t length = vector->GetSize(); in Insert() local 48 if (index < 0 || index > static_cast<int32_t>(length)) { in Insert() 51 GrowCapacity(thread, vector, length + 1); in Insert() 55 for (int32_t i = static_cast<int32_t>(length) - 1; i >= index; i--) { in Insert() 60 vector->SetLength(++length); in Insert() 107 uint32_t length = vector->GetSize(); in GetIndexFrom() local [all …]
|
/arkcompiler/ets_frontend/arkguard/test/ut/utils/ |
D | ListUtil.spec.ts | 24 assert.isTrue(arr.length === 0); 29 assert.isTrue(arr.length === 0); 34 assert.isTrue(arr.length === 0); 39 assert.isTrue(arr.length === ListUtil.MAX_INIT_LEN); 44 assert.isTrue(arr.length === 0); 69 for (let i = 1; i < arr.length; i++) { 85 assert.isTrue(arrUnique.length === 0); 95 assert.isTrue(arrUnique.length === expectedArr.length); 108 assert.isTrue(arrUnique.length === expectedArr.length); 120 assert.isTrue(arrUnique.length === 0); [all …]
|
/arkcompiler/ets_runtime/ecmascript/tests/ |
D | js_date_test.cpp | 94 JSTaggedValue ms = ecmascript::JSDate::GetTimeFromString(str.c_str(), str.length()); in HWTEST_F_L0() 98 ms = ecmascript::JSDate::GetTimeFromString(str.c_str(), str.length()); in HWTEST_F_L0() 102 ms = ecmascript::JSDate::GetTimeFromString(str.c_str(), str.length()); in HWTEST_F_L0() 106 ms = ecmascript::JSDate::GetTimeFromString(str.c_str(), str.length()); in HWTEST_F_L0() 110 ms = ecmascript::JSDate::GetTimeFromString(str.c_str(), str.length()); in HWTEST_F_L0() 114 ms = ecmascript::JSDate::GetTimeFromString(str.c_str(), str.length()); in HWTEST_F_L0() 118 ms = ecmascript::JSDate::GetTimeFromString(str.c_str(), str.length()); in HWTEST_F_L0() 122 ms = ecmascript::JSDate::GetTimeFromString(str.c_str(), str.length()); in HWTEST_F_L0() 126 ms = ecmascript::JSDate::GetTimeFromString(str.c_str(), str.length()); in HWTEST_F_L0() 130 ms = ecmascript::JSDate::GetTimeFromString(str.c_str(), str.length()); in HWTEST_F_L0() [all …]
|
D | concurrent_marking_test.cpp | 57 …JSHandle<TaggedArray> CreateTaggedArray(uint32_t length, JSTaggedValue initVal, MemSpaceType space… in CreateTaggedArray() argument 60 return factory->NewTaggedArray(length, initVal, spaceType); in CreateTaggedArray() 70 uint32_t length = 1_KB; in HWTEST_F_L0() local 72 CreateTaggedArray(length, JSTaggedValue::Undefined(), MemSpaceType::OLD_SPACE); in HWTEST_F_L0() 73 for (uint32_t i = 0; i < length; i++) { in HWTEST_F_L0() 74 auto array = CreateTaggedArray(length, JSTaggedValue::Undefined(), MemSpaceType::OLD_SPACE); in HWTEST_F_L0() 79 for (uint32_t i = 0; i < length; i++) { in HWTEST_F_L0() 80 auto array = CreateTaggedArray(length, JSTaggedValue::Undefined(), MemSpaceType::OLD_SPACE); in HWTEST_F_L0() 88 uint32_t length = 1_KB; in HWTEST_F_L0() local 90 CreateTaggedArray(length, JSTaggedValue::Undefined(), MemSpaceType::OLD_SPACE); in HWTEST_F_L0() [all …]
|
D | js_array_buffer_test.cpp | 63 size_t length = 5; in HWTEST_F_L0() local 64 void *toBuffer = vm->GetNativeAreaAllocator()->AllocateBuffer(length); in HWTEST_F_L0() 66 uint8_t *data = static_cast<uint8_t *>(vm->GetNativeAreaAllocator()->AllocateBuffer(length)); in HWTEST_F_L0() 67 if (memset_s(data, length, value, length) != EOK) { in HWTEST_F_L0() 71 void *formBuffer = vm->GetNativeAreaAllocator()->AllocateBuffer(length); in HWTEST_F_L0() 80 for (uint32_t i = 0; i < length; i++) { in HWTEST_F_L0() 100 size_t length = 5; in HWTEST_F_L0() local 103 uint8_t *data = static_cast<uint8_t *>(vm->GetNativeAreaAllocator()->AllocateBuffer(length)); in HWTEST_F_L0() 104 if (memset_s(data, length, value, length) != EOK) { in HWTEST_F_L0() 111 … arrBuf->Attach(thread, length + 1, JSHandle<JSTaggedValue>::Cast(nativePointer).GetTaggedValue()); in HWTEST_F_L0()
|
/arkcompiler/ets_runtime/test/aottest/exception_case14/ |
D | exception_case14.js | 39 var alphabet, cc, caseChanged, ee, i, isNum, length, str, 83 ee = str.length; 87 intCheck(bb, 2, ALPHABET.length, 'Base'); 96 if (BigNum.DEBUG && str.replace(/^0\.0*|\./, '').length > 15) { 105 for (length = str.length; i < length; i++) { 109 ee = length; 127 else ee = str.length; 130 for (length = str.length; str.charCodeAt(--length) === 48;); 131 if (str = str.slice(i, ++length)) { 132 length -= i; [all …]
|
/arkcompiler/runtime_core/static_core/runtime/regexp/ecmascript/mem/ |
D | dyn_chunk.cpp | 70 int DynChunk::Emit(const uint8_t *data, size_t length) in Emit() argument 72 if (UNLIKELY((size_ + length) > allocatedSize_)) { in Emit() 73 if (Expand(size_ + length) != 0) { in Emit() 79 length, data, length) != EOK) { in Emit() 82 size_ += length; in Emit() 91 int DynChunk::EmitSelf(size_t offset, size_t length) in EmitSelf() argument 93 if (UNLIKELY((size_ + length) > allocatedSize_)) { in EmitSelf() 94 if (Expand(size_ + length) != 0) { in EmitSelf() 100 length, in EmitSelf() 102 length) != EOK) { in EmitSelf() [all …]
|
/arkcompiler/ets_runtime/ecmascript/mem/ |
D | dyn_chunk.cpp | 71 int DynChunk::Emit(const uint8_t *data, size_t length) in Emit() argument 73 if (UNLIKELY((size_ + length) > allocatedSize_)) { in Emit() 74 if (Expand(size_ + length) != 0) { in Emit() 80 length, data, length) != EOK) { in Emit() 83 size_ += length; in Emit() 92 int DynChunk::EmitSelf(size_t offset, size_t length) in EmitSelf() argument 94 if (UNLIKELY((size_ + length) > allocatedSize_)) { in EmitSelf() 95 if (Expand(size_ + length) != 0) { in EmitSelf() 101 length, in EmitSelf() 103 length) != EOK) { in EmitSelf() [all …]
|
/arkcompiler/ets_runtime/test/aottest/builtins_array/ |
D | builtins_array.ts | 21 print(array1.length); 22 print(array2.length); 25 print(Array().length); // c++ path 26 print(Array(1).length); // c++ path 30 print(array3.length); 37 print(array3.length); 44 print(array3.length);
|
/arkcompiler/ets_runtime/ecmascript/ |
D | ecma_string-inl.h | 124 inline EcmaString *EcmaString::CreateLineString(const EcmaVM *vm, size_t length, bool compressed) in CreateLineString() argument 126 …size = compressed ? LineEcmaString::ComputeSizeUtf8(length) : LineEcmaString::ComputeSizeUtf16(len… in CreateLineString() 128 string->SetLength(length, compressed); in CreateLineString() 134 inline EcmaString *EcmaString::CreateLineStringNoGC(const EcmaVM *vm, size_t length, bool compresse… in CreateLineStringNoGC() argument 136 …size = compressed ? LineEcmaString::ComputeSizeUtf8(length) : LineEcmaString::ComputeSizeUtf16(len… in CreateLineStringNoGC() 142 string->SetLength(length, compressed); in CreateLineStringNoGC() 148 inline EcmaString *EcmaString::CreateLineStringWithSpaceType(const EcmaVM *vm, size_t length, bool … in CreateLineStringWithSpaceType() argument 151 …size = compressed ? LineEcmaString::ComputeSizeUtf8(length) : LineEcmaString::ComputeSizeUtf16(len… in CreateLineStringWithSpaceType() 167 string->SetLength(length, compressed); in CreateLineStringWithSpaceType() 180 size_t length, bool compressed, MemSpaceType type, uint32_t idOffset) in CreateConstantString() argument [all …]
|
/arkcompiler/runtime_core/static_core/runtime/include/coretypes/ |
D | string.h | 65 …PANDA_PUBLIC_API static String *CreateNewStringFromChars(uint32_t offset, uint32_t length, Array *… 68 …static String *CreateNewStringFromBytes(uint32_t offset, uint32_t length, uint32_t highByte, Array… 91 static size_t ComputeDataSizeUtf16(uint32_t length) in ComputeDataSizeUtf16() argument 93 return length * sizeof(dataUtf16_[0]); in ComputeDataSizeUtf16() 146 size_t CopyDataRegionMUtf8(uint8_t *buf, size_t start, size_t length, size_t maxLength) in CopyDataRegionMUtf8() argument 148 if (length > maxLength) { in CopyDataRegionMUtf8() 152 if (start + length > len) { in CopyDataRegionMUtf8() 157 if (length > MAX_LEN) { in CopyDataRegionMUtf8() 161 … if (memcpy_s(buf, sizeof(uint8_t) * (maxLength + 1), GetDataMUtf8() + start, length) != EOK) { in CopyDataRegionMUtf8() 164 return length; in CopyDataRegionMUtf8() [all …]
|
/arkcompiler/ets_runtime/test/fuzztest/stringrefwriteutf16_fuzzer/ |
D | stringrefwriteutf16_fuzzer.cpp | 35 int length = size / sizeof(char16_t); in StringRefWriteUtf16FuzzTest() local 36 char16_t* buffer = new char16_t[length]; in StringRefWriteUtf16FuzzTest() 37 if (memset_s(buffer, length, 0, length) != EOK) { in StringRefWriteUtf16FuzzTest() 41 Local<StringRef> res = StringRef::NewFromUtf16(vm, (char16_t*)data, length); in StringRefWriteUtf16FuzzTest() 42 if (length == 1) { in StringRefWriteUtf16FuzzTest() 44 } else if (length != 0) { in StringRefWriteUtf16FuzzTest() 45 int count = res->WriteUtf16(buffer, length - 1); in StringRefWriteUtf16FuzzTest()
|
/arkcompiler/runtime_core/static_core/plugins/ets/tests/stdlib-templates/escompat/ |
D | escompat_Array.ets | 116 let length: int = array.length(); 120 length--; 121 if(array.length() != length) { 122 … console.println("Target array length mismatch: " + array.length() + " but expected" + length); 131 for(let i: int = 0; i< array.length(); i++) { 143 let length: int = array.length(); 146 if(array.length() != 0) { 160 let length: int = array.length(); 164 length--; 165 if(array.length() != length) { [all …]
|
/arkcompiler/ets_frontend/arkguard/src/utils/ |
D | ListUtil.ts | 25 public static getInitList(length: number): number[] { 26 if (isNaN(length) || length < 0 || length > this.MAX_INIT_LEN) { 31 return Array(length).fill(null).map((_, h) => h); 43 for (let i = originList.length; i > 0; i--) { 44 let j = crypto.randomInt(originList.length);
|
/arkcompiler/ets_runtime/test/aottest/typedarray_load_store/ |
D | typedarray_load_store.ts | 44 let resLength: number = res.length; 46 let length: number = resources.length - 1; 48 num += integerIndexes[i % num & length]; 49 res[i % resLength] += resources[i % num & length]; 90 let resLength: number = res.length; 92 let length: number = resources.length - 1; 94 num += integerIndexes[i % num & length]; 95 res[i % resLength] += resources[i % num & length];
|
/arkcompiler/ets_runtime/tools/circuit_viewer/src/engine/control/ |
D | XSelect.js | 54 if (list.length > model) { 55 for (let i = list.length - model; i < list.length; i++) { 57 if (i !== list.length - 1) { 73 20 * this.list_.length, 84 if (list.length > model) { 85 for (let k = list.length - model; k < list.length; k++) { 87 if (k !== list.length - 1) { 116 if (y > this.posY_ + this.posH_ + (this.open_ ? 20 * this.list_.length : 0)) 129 if (this.tmpSelect_ >= 0 && this.tmpSelect_ <= this.list_.length) {
|