!9691 label release bug

Merge pull request !9691 from transparent123123/tzr_label_bug
This commit is contained in:
openharmony_ci 2024-10-15 10:41:23 +00:00 committed by Gitee
commit 33dabe0f4f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
6 changed files with 83 additions and 2 deletions

View File

@ -679,8 +679,9 @@ GateRef TypedNativeInlineLowering::BuildDoubleAbs(GateRef value)
GateRef TypedNativeInlineLowering::BuildTNumberAbs(GateRef param)
{
ASSERT(!acc_.GetGateType(param).IsNJSValueType());
Label entry(&builder_);
builder_.SubCfgEntry(&entry);
DEFVALUE(result, (&builder_), VariableType::JS_ANY(), builder_.HoleConstant());
Label exit(&builder_);
Label isInt(&builder_);
Label notInt(&builder_);
@ -713,7 +714,9 @@ GateRef TypedNativeInlineLowering::BuildTNumberAbs(GateRef param)
builder_.Jump(&exit);
}
builder_.Bind(&exit);
return *result;
GateRef res = *result;
builder_.SubCfgExit();
return res;
}
void TypedNativeInlineLowering::LowerAbs(GateRef gate)

View File

@ -346,6 +346,7 @@ group("ark_aot_ts_test") {
"sendable",
"webkit_call_convention",
"retype_isnan",
"inline_abs",
]
if (!is_debug) {

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("inline_abs") {
deps = []
is_enable_pgo = true
is_enable_opt_inlining = true
}

View File

@ -0,0 +1,14 @@
# 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.
true

View File

@ -0,0 +1,29 @@
/*
* 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.
*/
declare interface ArkTools {
isAOTCompiled(args: any): boolean;
}
declare function print(arg:any):string;
function test(x, y): void {
var ret = Math.sqrt(Math.abs(x));
return ret;
}
for (var i = 0; i < 100000; i++) {
test(3, 5);
}
print(ArkTools.isAOTCompiled(test));

View File

@ -0,0 +1,14 @@
# 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.
false