!8171 Fix bug of updating elementsKind

Merge pull request !8171 from 王不薄/workload_elementsKind
This commit is contained in:
openharmony_ci 2024-07-20 11:26:45 +00:00 committed by Gitee
commit e513d62d79
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
6 changed files with 196 additions and 0 deletions

View File

@ -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);

View File

@ -114,6 +114,7 @@ group("ark_aot_ts_test") {
"duplicatefunctions",
"duplicatekey",
"elements_kind",
"elements_kind_update",
"equal_nan",
"exception_case1",
"exception_case10",

View 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
}

View 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();

View 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

View 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