mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 10:09:54 +00:00
Fix bug of pgo crash when dumping IC by name
When updating transition for parent and child, if the parent layout information can not be found in transition layout record, directly return false instead of updating to avoid segmentation fault. Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/IALR0P Signed-off-by: wangyuxin <wangyuxin53@huawei.com> Change-Id: I0cbe003c91a26e5894d616642422aa1dfec15524
This commit is contained in:
parent
5be332038b
commit
d3e8863c3a
@ -163,6 +163,10 @@ bool PGOHClassTreeDesc::UpdateForTransition(
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (transitionLayout_.find(parentType) == transitionLayout_.end()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ret = DumpForChild(child, childType);
|
||||
auto parentLayoutDesc = transitionLayout_.find(parentType)->second;
|
||||
auto childLayoutDesc = transitionLayout_.find(childType)->second;
|
||||
|
@ -222,6 +222,7 @@ group("ark_aot_ts_test") {
|
||||
"pgo_class_prototype",
|
||||
"pgo_constant_value_deopt",
|
||||
"pgo_constructor_number",
|
||||
"pgo_element_transition",
|
||||
"pgo_elimination_loadconstoffset",
|
||||
"pgo_fast_call_bridge",
|
||||
"pgo_fast_call_deopt_bridge",
|
||||
|
19
test/aottest/pgo_element_transition/BUILD.gn
Normal file
19
test/aottest/pgo_element_transition/BUILD.gn
Normal file
@ -0,0 +1,19 @@
|
||||
# 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("pgo_element_transition") {
|
||||
deps = []
|
||||
is_enable_pgo = true
|
||||
}
|
15
test/aottest/pgo_element_transition/expect_output.txt
Normal file
15
test/aottest/pgo_element_transition/expect_output.txt
Normal file
@ -0,0 +1,15 @@
|
||||
# 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.
|
||||
|
||||
1
|
||||
1
|
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
function foo(){
|
||||
let res ={
|
||||
3:1,
|
||||
__proto__:{},
|
||||
}
|
||||
return res;
|
||||
}
|
||||
let obj = foo()
|
||||
obj.d = 1
|
||||
print(obj.d)
|
||||
print(obj[3])
|
15
test/aottest/pgo_element_transition/pgo_expect_output.txt
Normal file
15
test/aottest/pgo_element_transition/pgo_expect_output.txt
Normal file
@ -0,0 +1,15 @@
|
||||
# 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.
|
||||
|
||||
1
|
||||
1
|
Loading…
Reference in New Issue
Block a user