Home
last modified time | relevance | path

Searched refs:typedArray (Results 1 – 25 of 55) sorted by relevance

123

/arkcompiler/runtime_core/static_core/plugins/ets/tests/interop_js/tests/test_transfer/ets_to_ts/
Dtransfer_to_ts.ts31 export function testDynamicInt8Array(typedArray: Int8Array): void {
32 ASSERT_TRUE(typedArray instanceof Int8Array);
33 ASSERT_TRUE(typedArray.length === 2);
34 ASSERT_TRUE(typedArray[0] === 1);
35 ASSERT_TRUE(typedArray[1] === 2);
37 typedArray[0] = 3;
38 typedArray[1] = 4;
39 ASSERT_TRUE(typedArray[0] === 3);
40 ASSERT_TRUE(typedArray[1] === 4);
42 ASSERT_TRUE(typedArray[2] === undefined);
[all …]
/arkcompiler/ets_runtime/test/aottest/aot_type_test/uint32Array/
Duint32Array.ts18 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/
Duint8ClampedArray.ts18 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/int8Array/
Dint8Array.ts18 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/uint16Array/
Duint16Array.ts18 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/ets_runtime/test/aottest/aot_type_test/int32Array/
Dint32Array.ts18 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/int16Array/
Dint16Array.ts18 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/
Duint8Array.ts18 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/runtime_core/static_core/plugins/ets/tests/ets_func_tests/escompat/
DBigInt64Test.ets27 let typedArray = new BigInt64Array(1)
28 typedArray[0] = vals[0]
29 assertEQ(typedArray[0], 2n)
33 let typedArray = new BigInt64Array(1)
34 typedArray[0] = vals[1]
35 assertEQ(typedArray[0], -9223372036854775806n)
39 let typedArray = new BigInt64Array(1)
40 typedArray[0] = vals[2]
41 assertEQ(typedArray[0], 2n)
45 let typedArray = new BigInt64Array(1)
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/stdlib/escompat/
DAtomics.ets91 * @param typedArray typed array of values
92 * @param { number } index index of current value in the typedArray
96 …public static add(typedArray: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uin…
97 let buffer = typedArray.buffer
99 let byteOffset = typedArray.byteOffset as int;
100 if (typedArray instanceof Int8Array) {
102 } else if (typedArray instanceof Int16Array) {
104 } else if (typedArray instanceof Int32Array) {
106 } else if (typedArray instanceof Uint8Array) {
108 } else if (typedArray instanceof Uint16Array) {
[all …]
/arkcompiler/ets_runtime/ecmascript/base/
Datomic_helper.cpp22 …Value AtomicHelper::ValidateIntegerTypedArray(JSThread *thread, JSHandle<JSTaggedValue> typedArray, in ValidateIntegerTypedArray() argument
27 JSTaggedValue buffer = TypedArrayHelper::ValidateTypedArray(thread, typedArray); in ValidateIntegerTypedArray()
35 JSTypedArray::Cast(typedArray->GetTaggedObject())->GetTypedArrayName(thread)); in ValidateIntegerTypedArray()
59 …32_t AtomicHelper::ValidateAtomicAccess(JSThread *thread, const JSHandle<JSTaggedValue> typedArray, in ValidateAtomicAccess() argument
63 ASSERT(typedArray->IsECMAObject() && typedArray->IsTypedArray()); in ValidateAtomicAccess()
65 JSHandle<JSObject> typedArrayObj(typedArray); in ValidateAtomicAccess()
66 JSHandle<JSTypedArray> srcObj(typedArray); in ValidateAtomicAccess()
91 JSTaggedValue AtomicHelper::AtomicStore(JSThread *thread, const JSHandle<JSTaggedValue> &typedArray, in AtomicStore() argument
94 JSTaggedValue bufferValue = ValidateIntegerTypedArray(thread, typedArray); in AtomicStore()
97 uint32_t indexedPosition = ValidateAtomicAccess(thread, typedArray, index); in AtomicStore()
[all …]
/arkcompiler/ets_runtime/test/aottest/aot_type_test/float64Array/
Dfloat64Array.ts18 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/
Dtest_core_typedarray_function2.j2503 let typedArray: {{.item.objectType}};
506 typedArray = new {{.item.objectType}}(ss);
512 let length = typedArray.length;
535 typedArray[0] = {{.item.create}}(1);
536 typedArray[1] = {{.item.create}}(2);
537 typedArray[2] = {{.item.create}}(minValue);
538 typedArray[3] = {{.item.create}}(maxValue);
539 typedArray[4] = {{.item.create}}(-1);
547 for (let i = 0; i < typedArray.length; i++) {
548 if (typedArray[i] != {{.item.create}}(expectedArray[i])) {
[all …]
Dtest_core_typedarray_methods.j297 let typedArray: {{.item.objectType}};
100 typedArray = new {{.item.objectType}}(ss);
106 let length = typedArray.length;
109 typedArray[0] = {{.item.create}}(1);
110 typedArray[1] = {{.item.create}}(2);
111 typedArray[2] = {{.item.create}}(3);
112 typedArray[3] = {{.item.create}}(4);
113 typedArray[4] = {{.item.create}}(5);
119 let arrayIterator = typedArray.$_iterator();
126 … if (typedArray[counter]{{.item.cast2primitive}} != (next.value!){{.item.cast2primitive}}) {
[all …]
/arkcompiler/ets_runtime/test/fuzztest/jsvaluerefisarray_fuzzer/
Djsvaluerefisarray_fuzzer.cpp35 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/
Dfloat32Array.ts18 let typedArray : Float32Array = new Float32Array(1);
19 typedArray[0] = 1;
20 print(typedArray[0])
/arkcompiler/ets_runtime/test/moduletest/typedarrayjoin/
Dtypedarrayjoin.js31 let typedArray; variable
35 ArkTools.arrayBufferDetach(typedArray.buffer);
41 typedArray = new constructor(arr); variable
42 assert_equal(typedArray.join(separator) == '*',true);
/arkcompiler/ets_runtime/test/aottest/mono_builtin/
Dmono_builtin.ts37 const typedArray = new Int8Array(8); variable
38 typedArray[0] = 32;
40 foo(typedArray)
/arkcompiler/ets_runtime/test/fuzztest/jsvaluereffoundationvalue_fuzzer/
Djsvaluereffoundationvalue_fuzzer.cpp61 Local<Uint32ArrayRef> typedArray = Uint32ArrayRef::New(vm, ref, byteOffset, length); in JSValueRefFoundationValueFuzzTest() local
73 typedArray->IsNumber(); in JSValueRefFoundationValueFuzzTest()
85 typedArray->IsString(vm); in JSValueRefFoundationValueFuzzTest()
97 typedArray->WithinInt32(); in JSValueRefFoundationValueFuzzTest()
109 typedArray->IsFunction(vm); in JSValueRefFoundationValueFuzzTest()
121 typedArray->IsArrayBuffer(vm); in JSValueRefFoundationValueFuzzTest()
133 typedArray->IsTypedArray(vm); in JSValueRefFoundationValueFuzzTest()
145 typedArray->IsDate(vm); in JSValueRefFoundationValueFuzzTest()
157 typedArray->IsError(vm); in JSValueRefFoundationValueFuzzTest()
169 typedArray->ToString(vm); in JSValueRefFoundationValueFuzzTest()
/arkcompiler/ets_runtime/test/fuzztest/jsvaluerefisbig64array_fuzzer/
Djsvaluerefisbig64array_fuzzer.cpp48 … 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/
Djs_typed_array.cpp435 bool JSTypedArray::IsValidIntegerIndex(JSThread *thread, const JSHandle<JSTaggedValue> &typedArray,… in IsValidIntegerIndex() argument
438 ASSERT(typedArray->IsTypedArray() || typedArray->IsSharedTypedArray()); in IsValidIntegerIndex()
440 JSHandle<JSTypedArray> typedarrayObj(typedArray); in IsValidIntegerIndex()
515 …l JSTypedArray::FastCopyElementToArray(JSThread *thread, const JSHandle<JSTaggedValue> &typedArray, in FastCopyElementToArray() argument
520 ASSERT(typedArray->IsTypedArray() || typedArray->IsSharedTypedArray()); in FastCopyElementToArray()
522 JSHandle<JSTypedArray> typedarrayObj(typedArray); in FastCopyElementToArray()
735 JSTaggedValue JSTypedArray::GetOffHeapBuffer(JSThread *thread, JSHandle<JSTypedArray> &typedArray) in GetOffHeapBuffer() argument
737 JSTaggedValue arrBuf = typedArray->GetViewedArrayBufferOrByteArray(thread); in GetOffHeapBuffer()
748 …ByteArray::Cast(typedArray->GetViewedArrayBufferOrByteArray(thread).GetTaggedObject())->GetData())… in GetOffHeapBuffer()
754 typedArray->SetViewedArrayBufferOrByteArray(thread, arrayBuffer.GetTaggedValue()); in GetOffHeapBuffer()
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_sdk/api/@ohos/util/
DTextEncoderTest.ets95 let typedArray = new Uint8Array([97,98,99,185,254,236,218]);
96 for (let i = 0; i < typedArray.length; i++) {
97 assertEQ(result[i], typedArray[i]);
144 let typedArray = new Uint8Array(buffer)
145 let encodeIntoUint8ArrayInfo = enc.encodeIntoUint8Array('@1h-+=&^', typedArray);
154 assertEQ(bytes[i], typedArray[i]);
162 let typedArray = new Uint8Array(buffer);
163 let encodeIntoUint8ArrayInfo = enc.encodeIntoUint8Array('abcdefg', typedArray)
170 assertEQ(bytes[i], typedArray[i]);
178 let typedArray = new Uint8Array(buffer);
[all …]
/arkcompiler/ets_runtime/ecmascript/napi/test/
Djsnapi_first_tests.cpp397 Local<TypedArrayRef> typedArray = testString1->EncodeIntoUint8Array(vm_); in HWTEST_F_L0() local
398 EXPECT_TRUE(typedArray->IsUndefined()); in HWTEST_F_L0()
408 Local<TypedArrayRef> typedArray = testString1->EncodeIntoUint8Array(vm_); in HWTEST_F_L0() local
410 char *res = reinterpret_cast<char *>(typedArray->GetArrayBuffer(vm_)->GetBuffer(vm_)); in HWTEST_F_L0()
851 Local<Int8ArrayRef> typedArray = Int8ArrayRef::New(vm_, arrayBuffer, 5, 6); in HWTEST_F_L0() local
852 ASSERT_TRUE(typedArray->IsInt8Array(vm_)); in HWTEST_F_L0()
853 ASSERT_EQ(typedArray->ByteLength(vm_), 6U); // 6 : length of bytes in HWTEST_F_L0()
854 ASSERT_EQ(typedArray->ByteOffset(vm_), 5U); // 5 : offset of byte in HWTEST_F_L0()
855 ASSERT_EQ(typedArray->ArrayLength(vm_), 6U); // 6 : length of array in HWTEST_F_L0()
856 ASSERT_EQ(typedArray->GetArrayBuffer(vm_)->GetBuffer(vm_), arrayBuffer->GetBuffer(vm_)); in HWTEST_F_L0()
[all …]
/arkcompiler/ets_runtime/ecmascript/builtins/
Dbuiltins_atomics.cpp39 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/runtime_core/static_core/plugins/ets/sdk/native/
Dmain.cpp86 static ani_string Decode(ani_env *env, ani_object object, ani_object typedArray, ani_boolean stream) in Decode() argument
90 const char *data = GetUint8ArrayInfo(env, typedArray, byteLength, byteOffset); in Decode()
210 static ani_string DoWrite(ani_env *env, ani_object object, ani_object typedArray) in DoWrite() argument
214 const char *data = GetUint8ArrayInfo(env, typedArray, byteLength, byteOffset); in DoWrite()
223 static ani_string DoEnd(ani_env *env, ani_object object, ani_object typedArray) in DoEnd() argument
225 ani_boolean isUndefined = AniUtilsIsUndefined(env, typedArray); in DoEnd()
235 ani_boolean isTypeArray = AniUtilsIsTypeArray(env, typedArray); in DoEnd()
241 const char *data = GetUint8ArrayInfo(env, typedArray, byteLength, byteOffset); in DoEnd()

123