| /arkcompiler/ets_runtime/test/aottest/aot_type_test/uint32Array/ |
| D | uint32Array.ts | 18 let typedArray : Uint32Array = new Uint32Array([1, 2, 4294967290, 5, 5, 5, 6, 6, 4294967295]); 19 print(typedArray[2]); 20 typedArray[0] = typedArray[2] + typedArray[4]; //upper bound 21 print(typedArray[0]); 22 typedArray[1] = typedArray[3] - typedArray[5]; //lower bound 23 print(typedArray[1]); 24 typedArray[0] = typedArray[2] + typedArray[6]; //over flow 25 print(typedArray[0]); 26 typedArray[1] = typedArray[3] - typedArray[7]; //under spill 27 print(typedArray[1]); [all …]
|
| /arkcompiler/ets_runtime/test/aottest/aot_type_test/uint8ClampedArray/ |
| D | uint8ClampedArray.ts | 18 let typedArray : Uint8ClampedArray = new Uint8ClampedArray([8848, -6666, 250, 5, 5, 5, 7, 7]); 19 print(typedArray[0]); 20 print(typedArray[1]); 21 typedArray[0] = typedArray[2] + typedArray[4]; //upper bound 22 print(typedArray[0]); 23 typedArray[1] = typedArray[3] - typedArray[5]; //lower bound 24 print(typedArray[1]); 25 typedArray[0] = typedArray[2] + typedArray[6]; //over flow 26 print(typedArray[0]); 27 typedArray[1] = typedArray[3] - typedArray[7]; //under spill [all …]
|
| /arkcompiler/ets_runtime/test/aottest/aot_type_test/int16Array/ |
| D | int16Array.ts | 18 let typedArray : Int16Array = new Int16Array([1, 2, 32760, -32760, 7, 8, 8, 9]); 19 typedArray[0] = typedArray[2] + typedArray[4]; //upper bound 20 print(typedArray[0]); 21 typedArray[1] = typedArray[3] - typedArray[5]; //lower bound 22 print(typedArray[1]); 23 typedArray[0] = typedArray[2] + typedArray[6]; //over flow 24 print(typedArray[0]); 25 typedArray[1] = typedArray[3] - typedArray[7]; //under spill 26 print(typedArray[1]); 27 let s = typedArray[2] + typedArray[6]; [all …]
|
| /arkcompiler/ets_runtime/test/aottest/aot_type_test/uint8Array/ |
| D | uint8Array.ts | 18 let typedArray : Uint8Array = new Uint8Array([1, 2, 250, 5, 5, 5, 6, 6]); 19 typedArray[0] = typedArray[2] + typedArray[4]; //upper bound 20 print(typedArray[0]); 21 typedArray[1] = typedArray[3] - typedArray[5]; //lower bound 22 print(typedArray[1]); 23 typedArray[0] = typedArray[2] + typedArray[6]; //over flow 24 print(typedArray[0]); 25 typedArray[1] = typedArray[3] - typedArray[7]; //under spill 26 print(typedArray[1]); 27 let s = typedArray[2] + typedArray[6]; [all …]
|
| /arkcompiler/ets_runtime/test/aottest/aot_type_test/int8Array/ |
| D | int8Array.ts | 18 let typedArray : Int8Array = new Int8Array([1, 2, 100, -100, 27, 28, 28, 29]); 19 typedArray[0] = typedArray[2] + typedArray[4]; //upper bound 20 print(typedArray[0]); 21 typedArray[1] = typedArray[3] - typedArray[5]; //lower bound 22 print(typedArray[1]); 23 typedArray[0] = typedArray[2] + typedArray[6]; //over flow 24 print(typedArray[0]); 25 typedArray[1] = typedArray[3] - typedArray[7]; //under spill 26 print(typedArray[1]); 27 let s = typedArray[2] + typedArray[6]; [all …]
|
| /arkcompiler/ets_runtime/test/aottest/aot_type_test/int32Array/ |
| D | int32Array.ts | 18 let typedArray : Int32Array = new Int32Array([1, 2, 2147483640, -2147483640, 7, 8, 8, 9]); 19 typedArray[0] = typedArray[2] + typedArray[4]; //upper bound 20 print(typedArray[0]); 21 typedArray[1] = typedArray[3] - typedArray[5]; //lower bound 22 print(typedArray[1]); 23 typedArray[0] = typedArray[2] + typedArray[6]; //over flow 24 print(typedArray[0]); 25 typedArray[1] = typedArray[3] - typedArray[7]; //under spill 26 print(typedArray[1]); 27 let s = typedArray[2] + typedArray[6]; [all …]
|
| /arkcompiler/ets_runtime/test/aottest/aot_type_test/uint16Array/ |
| D | uint16Array.ts | 18 let typedArray : Uint16Array = new Uint16Array([1, 2, 65530, 5, 5, 5, 6, 6]); 19 typedArray[0] = typedArray[2] + typedArray[4]; //upper bound 20 print(typedArray[0]); 21 typedArray[1] = typedArray[3] - typedArray[5]; //lower bound 22 print(typedArray[1]); 23 typedArray[0] = typedArray[2] + typedArray[6]; //over flow 24 print(typedArray[0]); 25 typedArray[1] = typedArray[3] - typedArray[7]; //under spill 26 print(typedArray[1]); 27 let s = typedArray[2] + typedArray[6]; [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/stdlib/escompat/ |
| D | Atomics.sts | 59 …public static add(typedArray: Int8Array | Int16Array | Int32Array | BigInt64Array | Uint8Array | U… 60 if (typedArray instanceof Int8Array) { 61 …sition = Atomics.validateAtomicAccess(typedArray.byteOffset as int, Int8Array.BYTES_PER_ELEMENT as… 62 let buffer = typedArray.buffer 64 let oldValue = typedArray[indexedPosition] 66 typedArray.set(indexedPosition, newValue) 72 } else if (typedArray instanceof Int16Array) { 73 …sition = Atomics.validateAtomicAccess(typedArray.byteOffset as int, Int16Array.BYTES_PER_ELEMENT a… 74 let buffer = typedArray.buffer 76 let oldValue = typedArray[indexedPosition] [all …]
|
| /arkcompiler/ets_runtime/ecmascript/base/ |
| D | atomic_helper.cpp | 22 …Value AtomicHelper::ValidateIntegerTypedArray(JSThread *thread, JSHandle<JSTaggedValue> typedArray, in ValidateIntegerTypedArray() argument 27 JSTaggedValue buffer = TypedArrayHelper::ValidateTypedArray(thread, typedArray); in ValidateIntegerTypedArray() 34 …JSHandle<JSTaggedValue> typeName(thread, JSTypedArray::Cast(typedArray->GetTaggedObject())->GetTyp… in ValidateIntegerTypedArray() 58 …32_t AtomicHelper::ValidateAtomicAccess(JSThread *thread, const JSHandle<JSTaggedValue> typedArray, in ValidateAtomicAccess() argument 62 ASSERT(typedArray->IsECMAObject() && typedArray->IsTypedArray()); in ValidateAtomicAccess() 64 JSHandle<JSObject> typedArrayObj(typedArray); in ValidateAtomicAccess() 65 JSHandle<JSTypedArray> srcObj(typedArray); in ValidateAtomicAccess() 95 JSTaggedValue AtomicHelper::AtomicStore(JSThread *thread, const JSHandle<JSTaggedValue> &typedArray, in AtomicStore() argument 98 JSTaggedValue bufferValue = ValidateIntegerTypedArray(thread, typedArray); in AtomicStore() 101 uint32_t indexedPosition = ValidateAtomicAccess(thread, typedArray, index); in AtomicStore() [all …]
|
| D | atomic_helper.h | 99 …tatic JSTaggedValue ValidateIntegerTypedArray(JSThread *thread, JSHandle<JSTaggedValue> typedArray, 102 static uint32_t ValidateAtomicAccess(JSThread *thread, const JSHandle<JSTaggedValue> typedArray, 104 static JSTaggedValue AtomicStore(JSThread *thread, const JSHandle<JSTaggedValue> &typedArray, 106 static JSTaggedValue AtomicLoad(JSThread *thread, const JSHandle<JSTaggedValue> &typedArray,
|
| /arkcompiler/ets_runtime/test/aottest/aot_type_test/float64Array/ |
| D | float64Array.ts | 18 let typedArray : Float64Array = new Float64Array([1.5, 2.5, 3, 4.5, 5.5, 6, 7]); 19 typedArray[0] = 1; 20 print(typedArray[0]) 22 for (let i = 0; i < typedArray.length; ++i) { 23 s += typedArray[i];
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/stdlib-templates/utils/ |
| D | test_core_typedarray_function2.j2 | 497 let typedArray: {{.item.objectType}}; 500 typedArray = new {{.item.objectType}}(ss); 506 let length = typedArray.length; 526 typedArray[0] = 1; 527 typedArray[1] = 2; 528 typedArray[2] = minValue; 529 typedArray[3] = maxValue; 530 typedArray[4] = -1; 538 for (let i = 0; i < typedArray.length; i++) { 539 if (typedArray[i] != expectedArray[i]) { [all …]
|
| D | test_core_typedarray_function1.j2 | 188 let typedArray: {{.item.objectType}}; 191 typedArray = new {{.item.objectType}}(ss); 197 let length = typedArray.length; 200 typedArray[0] = 1 as number; 201 typedArray[1] = 2 as number; 202 typedArray[2] = 3 as number; 203 typedArray[3] = 4 as number; 204 typedArray[4] = 5 as number; 210 let arrayIterator = typedArray.$_iterator(); 217 if (typedArray[counter] as number != (next.value) as number) { [all …]
|
| /arkcompiler/ets_runtime/test/fuzztest/jsvaluerefisarray_fuzzer/ |
| D | jsvaluerefisarray_fuzzer.cpp | 35 Local<JSValueRef> typedArray = Int8ArrayRef::New(vm, arrayBuffer, 0, (int32_t)size); in IsInt8ArrayFuzztest() local 36 typedArray->IsInt8Array(vm); in IsInt8ArrayFuzztest() 51 Local<JSValueRef> typedArray = Uint8ArrayRef::New(vm, arrayBuffer, 0, (int32_t)size); in IsUint8ArrayFuzztest() local 52 typedArray->IsUint8Array(vm); in IsUint8ArrayFuzztest() 67 Local<JSValueRef> typedArray = Uint8ClampedArrayRef::New(vm, arrayBuffer, 0, (int32_t)size); in IsUint8ClampedArrayFuzztest() local 68 typedArray->IsUint8ClampedArray(vm); in IsUint8ClampedArrayFuzztest() 84 Local<JSValueRef> typedArray = Int16ArrayRef::New(vm, arrayBuffer, 0, length); in IsInt16ArrayFuzztest() local 85 typedArray->IsInt16Array(vm); in IsInt16ArrayFuzztest() 101 Local<JSValueRef> typedArray = Uint16ArrayRef::New(vm, arrayBuffer, 0, length); in IsUint16ArrayFuzztest() local 102 typedArray->IsUint16Array(vm); in IsUint16ArrayFuzztest()
|
| /arkcompiler/ets_runtime/test/aottest/aot_type_test/float32Array/ |
| D | float32Array.ts | 18 let typedArray : Float32Array = new Float32Array(1); 19 typedArray[0] = 1; 20 print(typedArray[0])
|
| /arkcompiler/ets_runtime/test/fuzztest/typedarrayref_fuzzer/ |
| D | typedarrayref_fuzzer.cpp | 37 Local<Int8ArrayRef> typedArray = Int8ArrayRef::New(vm, arrayBuffer, byteOffset, length); in TypedArrayrefArrayLengthFuzzerTest() local 38 typedArray->ArrayLength(vm); in TypedArrayrefArrayLengthFuzzerTest() 54 Local<Int8ArrayRef> typedArray = Int8ArrayRef::New(vm, arrayBuffer, byteOffset, length); in TypedArrayrefByteOffSetFuzzerTest() local 55 typedArray->ByteOffset(vm); in TypedArrayrefByteOffSetFuzzerTest() 71 Local<Int8ArrayRef> typedArray = Int8ArrayRef::New(vm, arrayBuffer, byteOffset, length); in TypedArrayrefGetArrayBufferFuzzerTest() local 72 typedArray->GetArrayBuffer(vm); in TypedArrayrefGetArrayBufferFuzzerTest()
|
| /arkcompiler/ets_runtime/test/moduletest/typedarrayjoin/ |
| D | typedarrayjoin.js | 31 let typedArray; variable 35 ArkTools.arrayBufferDetach(typedArray.buffer); 41 typedArray = new constructor(arr); variable 42 print(typedArray.join(separator) == '*');
|
| /arkcompiler/ets_runtime/test/aottest/mono_builtin/ |
| D | mono_builtin.ts | 37 const typedArray = new Int8Array(8); variable 38 typedArray[0] = 32; 40 foo(typedArray)
|
| /arkcompiler/ets_runtime/test/fuzztest/jsvaluerefisbig64array_fuzzer/ |
| D | jsvaluerefisbig64array_fuzzer.cpp | 48 … Local<BigInt64ArrayRef> typedArray = BigInt64ArrayRef::New(vm, ref, (int32_t)size, (int32_t)size); in JSValueRefIsBigInt64ArrayFuzzTest() local 49 typedArray->IsBigInt64Array(vm); in JSValueRefIsBigInt64ArrayFuzzTest() 75 …Local<BigUint64ArrayRef> typedArray = BigUint64ArrayRef::New(vm, ref, (int32_t)size, (int32_t)size… in JSValueRefIsBigUint64ArrayRefNewFuzzTest() local 76 typedArray->IsBigUint64Array(vm); in JSValueRefIsBigUint64ArrayRefNewFuzzTest()
|
| /arkcompiler/ets_runtime/ecmascript/ |
| D | js_typed_array.cpp | 442 bool JSTypedArray::IsValidIntegerIndex(const JSHandle<JSTaggedValue> &typedArray, JSTaggedValue ind… in IsValidIntegerIndex() argument 446 JSHandle<JSTypedArray> typedarrayObj(typedArray); in IsValidIntegerIndex() 520 …l JSTypedArray::FastCopyElementToArray(JSThread *thread, const JSHandle<JSTaggedValue> &typedArray, in FastCopyElementToArray() argument 525 ASSERT(typedArray->IsTypedArray() || typedArray->IsSharedTypedArray()); in FastCopyElementToArray() 527 JSHandle<JSTypedArray> typedarrayObj(typedArray); in FastCopyElementToArray() 750 JSTaggedValue JSTypedArray::GetOffHeapBuffer(JSThread *thread, JSHandle<JSTypedArray> &typedArray) in GetOffHeapBuffer() argument 752 JSTaggedValue arrBuf = typedArray->GetViewedArrayBufferOrByteArray(); in GetOffHeapBuffer() 763 … ByteArray::Cast(typedArray->GetViewedArrayBufferOrByteArray().GetTaggedObject())->GetData())); in GetOffHeapBuffer() 769 typedArray->SetViewedArrayBufferOrByteArray(thread, arrayBuffer.GetTaggedValue()); in GetOffHeapBuffer() 770 JSHandle<JSTaggedValue> typeName(thread, typedArray->GetTypedArrayName()); in GetOffHeapBuffer() [all …]
|
| D | js_typed_array.h | 89 static bool FastCopyElementToArray(JSThread *thread, const JSHandle<JSTaggedValue> &typedArray, 95 static bool IsValidIntegerIndex(const JSHandle<JSTaggedValue> &typedArray, JSTaggedValue index); 102 static JSTaggedValue GetOffHeapBuffer(JSThread *thread, JSHandle<JSTypedArray> &typedArray); 103 static bool FastTypedArrayFill(JSThread *thread, const JSHandle<JSTaggedValue> &typedArray,
|
| /arkcompiler/ets_runtime/test/sharedtest/sharedtypedarray/ |
| D | sharedtypedarray.ts | 241 let typedArray; variable 244 ArkTools.arrayBufferDetach(typedArray.buffer); 250 typedArray = new constructor(arr); 251 print(typedArray.join() == '0,1'); 252 print(typedArray.join('-') == '0-1'); 253 print(typedArray.join(separator) == '*'); // detach array buffer 304 typedArray = new constructor(arr); 305 if (typedArray instanceof SendableBigInt64Array || typedArray instanceof SendableBigUint64Array) { 306 print(typedArray.includes(2n)); 307 print(typedArray.includes(4n)); [all …]
|
| /arkcompiler/ets_runtime/ecmascript/builtins/ |
| D | builtins_atomics.cpp | 39 JSHandle<JSTaggedValue> typedArray = GetCallArg(argv, 0); in Sub() local 41 return AtomicReadModifyWrite(thread, typedArray, index, argv, AtomicHelper::SubFun()); in Sub() 50 JSHandle<JSTaggedValue> typedArray = GetCallArg(argv, 0); in Add() local 52 return AtomicReadModifyWrite(thread, typedArray, index, argv, AtomicHelper::AddFun()); in Add() 61 JSHandle<JSTaggedValue> typedArray = GetCallArg(argv, 0); in And() local 63 return AtomicReadModifyWrite(thread, typedArray, index, argv, AtomicHelper::AndFun()); in And() 72 JSHandle<JSTaggedValue> typedArray = GetCallArg(argv, 0); in Or() local 74 return AtomicReadModifyWrite(thread, typedArray, index, argv, AtomicHelper::OrFun()); in Or() 83 JSHandle<JSTaggedValue> typedArray = GetCallArg(argv, 0); in Xor() local 85 return AtomicReadModifyWrite(thread, typedArray, index, argv, AtomicHelper::XorFun()); in Xor() [all …]
|
| /arkcompiler/ets_runtime/ecmascript/napi/test/ |
| D | jsnapi_first_tests.cpp | 814 Local<Int8ArrayRef> typedArray = Int8ArrayRef::New(vm_, arrayBuffer, 5, 6); in HWTEST_F_L0() local 815 ASSERT_TRUE(typedArray->IsInt8Array(vm_)); in HWTEST_F_L0() 816 ASSERT_EQ(typedArray->ByteLength(vm_), 6U); // 6 : length of bytes in HWTEST_F_L0() 817 ASSERT_EQ(typedArray->ByteOffset(vm_), 5U); // 5 : offset of byte in HWTEST_F_L0() 818 ASSERT_EQ(typedArray->ArrayLength(vm_), 6U); // 6 : length of array in HWTEST_F_L0() 819 ASSERT_EQ(typedArray->GetArrayBuffer(vm_)->GetBuffer(vm_), arrayBuffer->GetBuffer(vm_)); in HWTEST_F_L0() 839 Local<Uint8ArrayRef> typedArray = Uint8ArrayRef::New(vm_, arrayBuffer, 5, 6); in HWTEST_F_L0() local 840 ASSERT_TRUE(typedArray->IsUint8Array(vm_)); in HWTEST_F_L0() 841 ASSERT_EQ(typedArray->ByteLength(vm_), 6U); // 6 : length of bytes in HWTEST_F_L0() 842 ASSERT_EQ(typedArray->ByteOffset(vm_), 5U); // 5 : offset of byte in HWTEST_F_L0() [all …]
|
| /arkcompiler/ets_runtime/test/fuzztest/uint32arrayrefbytelength_fuzzer/ |
| D | uint32arrayrefbytelength_fuzzer.cpp | 48 Local<Uint32ArrayRef> typedArray = Uint32ArrayRef::New(vm, ref, (int32_t)size, (int32_t)size); in Uint32ArrayRefByteLengthFuzzTest() local 49 typedArray->ByteLength(vm); in Uint32ArrayRefByteLengthFuzzTest()
|