From f92907037343a67d2a68e166c6a71e488fbfe554 Mon Sep 17 00:00:00 2001 From: qiu_yu_jia Date: Mon, 8 Sep 2025 10:07:15 +0800 Subject: [PATCH] adjust byteOffset and byteLength order Issue: https://gitee.com/openharmony/arkcompiler_runtime_core/issues/ICWSPN Signed-off-by: qiu_yu_jia --- .../ets/runtime/types/ets_typed_arrays.h | 9 +++++++++ .../atomics/base_operation_add.ets | 1 + .../atomics/base_operation_and.ets | 1 + .../atomics/base_operation_bigint.ets | 1 + .../atomics/base_operation_biguint.ets | 1 + .../base_operation_compare_exchange.ets | 1 + .../atomics/base_operation_exchange.ets | 1 + .../atomics/base_operation_load.ets | 1 + .../atomics/base_operation_or.ets | 1 + .../atomics/base_operation_store.ets | 1 + .../atomics/base_operation_sub.ets | 1 + .../atomics/base_operation_xor.ets | 1 + .../unit-tests/unit-tests-ignored.txt | 20 ------------------- 13 files changed, 20 insertions(+), 20 deletions(-) diff --git a/static_core/plugins/ets/runtime/types/ets_typed_arrays.h b/static_core/plugins/ets/runtime/types/ets_typed_arrays.h index 8d009db27e..a3768d5daf 100644 --- a/static_core/plugins/ets/runtime/types/ets_typed_arrays.h +++ b/static_core/plugins/ets/runtime/types/ets_typed_arrays.h @@ -131,12 +131,21 @@ public: } private: +#if !defined(PANDA_32_BIT_MANAGED_POINTER) + ObjectPointer buffer_; + ObjectPointer name_; + EtsInt bytesPerElement_; + EtsInt byteOffset_; + EtsInt byteLength_; + EtsInt lengthInt_; +#else ObjectPointer buffer_; ObjectPointer name_; EtsInt bytesPerElement_; EtsInt lengthInt_; EtsInt byteOffset_; EtsInt byteLength_; +#endif friend class test::EtsEscompatTypedArrayBaseTest; }; diff --git a/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_add.ets b/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_add.ets index b48c9d3900..3a4c02c898 100644 --- a/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_add.ets +++ b/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_add.ets @@ -40,6 +40,7 @@ let typeArrayList = [ function testAdd() { for (let i = 0; i < typeArrayList.length; i++) { let ta = typeArrayList[i] + arktest.assertEQ(ta.byteOffset, 0) let arraySize = ta.length for (let j = 0; j < arraySize; j++) { diff --git a/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_and.ets b/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_and.ets index be50828099..6796076ce1 100644 --- a/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_and.ets +++ b/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_and.ets @@ -40,6 +40,7 @@ let typeArrayList = [ function testAnd() { for (let i = 0; i < typeArrayList.length; i++) { let ta = typeArrayList[i] + arktest.assertEQ(ta.byteOffset, 0) let arraySize = ta.length for (let j = 0; j < arraySize; j++) { diff --git a/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_bigint.ets b/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_bigint.ets index 8b2e078edb..31853ff33f 100644 --- a/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_bigint.ets +++ b/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_bigint.ets @@ -180,6 +180,7 @@ function testXorBigInt() { } function main() { + arktest.assertEQ(bigint64array.byteOffset, 0) const suite = new arktest.ArkTestsuite('Function Atomics base_operation_bigint tests') suite.addTest('Function testAddBigInt', testAddBigInt) suite.addTest('Function testAndBigInt', testAndBigInt) diff --git a/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_biguint.ets b/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_biguint.ets index 5524ab97e6..fa367ddbeb 100644 --- a/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_biguint.ets +++ b/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_biguint.ets @@ -180,6 +180,7 @@ function testXorBigUint() { } function main() { + arktest.assertEQ(biguint64array.byteOffset, 0) const suite = new arktest.ArkTestsuite('Function Atomics base_operation_biguint tests') suite.addTest('Function testAddBigUint', testAddBigUint) suite.addTest('Function testAndBigUint', testAndBigUint) diff --git a/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_compare_exchange.ets b/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_compare_exchange.ets index d4f4513fcc..89728ead0c 100644 --- a/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_compare_exchange.ets +++ b/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_compare_exchange.ets @@ -40,6 +40,7 @@ let typeArrayList = [ function testCompareExchange() { for (let i = 0; i < typeArrayList.length; i++) { let ta = typeArrayList[i] + arktest.assertEQ(ta.byteOffset, 0) let arraySize = ta.length for (let j = 1; j < arraySize; j++) { diff --git a/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_exchange.ets b/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_exchange.ets index 40247d3232..fe788ee019 100644 --- a/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_exchange.ets +++ b/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_exchange.ets @@ -40,6 +40,7 @@ let typeArrayList = [ function testExchange() { for (let i = 0; i < typeArrayList.length; i++) { let ta = typeArrayList[i] + arktest.assertEQ(ta.byteOffset, 0) let arraySize = ta.length for (let j = 0; j < arraySize; j++) { diff --git a/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_load.ets b/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_load.ets index efc2a4b5b2..97145d3563 100644 --- a/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_load.ets +++ b/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_load.ets @@ -40,6 +40,7 @@ let typeArrayList = [ function testLoad() { for (let i = 0; i < typeArrayList.length; i++) { let ta = typeArrayList[i] + arktest.assertEQ(ta.byteOffset, 0) let arraySize = ta.length for (let j = 0; j < arraySize; j++) { diff --git a/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_or.ets b/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_or.ets index 40c8da78b7..4d7e4f51fb 100644 --- a/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_or.ets +++ b/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_or.ets @@ -40,6 +40,7 @@ let typeArrayList = [ function testOr() { for (let i = 0; i < typeArrayList.length; i++) { let ta = typeArrayList[i] + arktest.assertEQ(ta.byteOffset, 0) let arraySize = ta.length for (let j = 0; j < arraySize; j++) { diff --git a/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_store.ets b/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_store.ets index 17327d8cfc..30ed00a816 100644 --- a/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_store.ets +++ b/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_store.ets @@ -40,6 +40,7 @@ let typeArrayList = [ function testStore() { for (let i = 0; i < typeArrayList.length; i++) { let ta = typeArrayList[i] + arktest.assertEQ(ta.byteOffset, 0) let arraySize = ta.length for (let j = 0; j < arraySize; j++) { diff --git a/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_sub.ets b/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_sub.ets index 8f699df2ac..3d465c85b9 100644 --- a/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_sub.ets +++ b/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_sub.ets @@ -40,6 +40,7 @@ let typeArrayList = [ function testSub() { for (let i = 0; i < typeArrayList.length; i++) { let ta = typeArrayList[i] + arktest.assertEQ(ta.byteOffset, 0) let arraySize = ta.length for (let j = 0; j < arraySize; j++) { diff --git a/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_xor.ets b/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_xor.ets index dda7875147..6b669d38bb 100644 --- a/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_xor.ets +++ b/static_core/plugins/ets/tests/ets-common-tests/atomics/base_operation_xor.ets @@ -40,6 +40,7 @@ let typeArrayList = [ function testXor() { for (let i = 0; i < typeArrayList.length; i++) { let ta = typeArrayList[i] + arktest.assertEQ(ta.byteOffset, 0) let arraySize = ta.length for (let j = 0; j < arraySize; j++) { diff --git a/static_core/plugins/ets/tests/test-lists/unit-tests/unit-tests-ignored.txt b/static_core/plugins/ets/tests/test-lists/unit-tests/unit-tests-ignored.txt index 86c3728943..2e42d12a8b 100644 --- a/static_core/plugins/ets/tests/test-lists/unit-tests/unit-tests-ignored.txt +++ b/static_core/plugins/ets/tests/test-lists/unit-tests/unit-tests-ignored.txt @@ -21,28 +21,8 @@ ets-common-tests/intrinsics/uint32array_sort.ets # 25111 fail in aot after primitive types removal ets-common-tests/intrinsics/typed_arrays_reverse.ets -# 28171 -ets-common-tests/atomics/base_operation_store.ets -ets-common-tests/atomics/base_operation_exchange.ets - # 27436 ets-common-tests/atomics/concurrent_wait_notify_all.ets #28060 ets-common-tests/taskpool/common_tasks.ets - -#28278 -ets-common-tests/atomics/base_operation_exchange.ets - -#28171 -ets-common-tests/atomics/base_operation_add.ets -ets-common-tests/atomics/base_operation_and.ets -ets-common-tests/atomics/base_operation_bigint.ets -ets-common-tests/atomics/base_operation_biguint.ets -ets-common-tests/atomics/base_operation_compare_exchange.ets -ets-common-tests/atomics/base_operation_exchange.ets -ets-common-tests/atomics/base_operation_load.ets -ets-common-tests/atomics/base_operation_or.ets -ets-common-tests/atomics/base_operation_store.ets -ets-common-tests/atomics/base_operation_sub.ets -ets-common-tests/atomics/base_operation_xor.ets -- Gitee