mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2025-02-25 23:08:22 +00:00
!8171 Fix bug of updating elementsKind
Merge pull request !8171 from 王不薄/workload_elementsKind
This commit is contained in:
commit
e513d62d79
@ -68,6 +68,10 @@ public:
|
||||
{
|
||||
auto result = objDefOpTypeInfos_.find(ObjDefOpTypeInfo(offset, type));
|
||||
if (result != objDefOpTypeInfos_.end()) {
|
||||
if (type.GetProfileType().IsArrayLiteralType()) {
|
||||
const_cast<PGODefineOpTemplate<ProfileType> *>(&((*result).GetTypeRef()))
|
||||
->SetElementsKind(type.GetElementsKind());
|
||||
}
|
||||
return;
|
||||
}
|
||||
objDefOpTypeInfos_.emplace(offset, type);
|
||||
|
@ -114,6 +114,7 @@ group("ark_aot_ts_test") {
|
||||
"duplicatefunctions",
|
||||
"duplicatekey",
|
||||
"elements_kind",
|
||||
"elements_kind_update",
|
||||
"equal_nan",
|
||||
"exception_case1",
|
||||
"exception_case10",
|
||||
|
20
test/aottest/elements_kind_update/BUILD.gn
Normal file
20
test/aottest/elements_kind_update/BUILD.gn
Normal file
@ -0,0 +1,20 @@
|
||||
# Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//arkcompiler/ets_runtime/test/test_helper.gni")
|
||||
|
||||
host_aot_test_action("elements_kind_update") {
|
||||
deps = []
|
||||
is_enable_pgo = true
|
||||
is_only_typed_path = true
|
||||
}
|
45
test/aottest/elements_kind_update/elements_kind_update.ts
Normal file
45
test/aottest/elements_kind_update/elements_kind_update.ts
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
interface ArkTools{
|
||||
getElementsKind(obj:any);
|
||||
}
|
||||
class EventBusClass {
|
||||
public result: Object[] = [];
|
||||
|
||||
public addEventListener(): void {
|
||||
this.result.push({});
|
||||
}
|
||||
|
||||
public removeEventListener(): void {
|
||||
this.result = [];
|
||||
}
|
||||
}
|
||||
|
||||
let EventBus = new EventBusClass();
|
||||
function main(): void {
|
||||
EventBus.addEventListener();
|
||||
for (let index = 0; index < 500000; index++) {
|
||||
EventBus.removeEventListener();
|
||||
}
|
||||
|
||||
for (let index = 0; index < 50; index++) {
|
||||
EventBus.addEventListener();
|
||||
EventBus.removeEventListener();
|
||||
print(ArkTools.getElementsKind(EventBus.result))
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
63
test/aottest/elements_kind_update/expect_output.txt
Normal file
63
test/aottest/elements_kind_update/expect_output.txt
Normal file
@ -0,0 +1,63 @@
|
||||
# Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
63
test/aottest/elements_kind_update/pgo_expect_output.txt
Normal file
63
test/aottest/elements_kind_update/pgo_expect_output.txt
Normal file
@ -0,0 +1,63 @@
|
||||
# Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
||||
16
|
Loading…
x
Reference in New Issue
Block a user