Fix ORDINARY_HAS_INSTANCE retype bug

Issues: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I8VPSO?from=project-issue
Signed-off-by: liuzhijie <liuzhijie9@huawei.com>

Change-Id: I8751442342065fbbba515189b01704ff10325bb0
This commit is contained in:
liuzhijie 2024-01-12 16:55:05 +08:00
parent c84ed8cba7
commit cc8e05d551
5 changed files with 57 additions and 0 deletions

View File

@ -155,6 +155,7 @@ GateRef NumberSpeculativeRetype::VisitGate(GateRef gate)
case OpCode::LD_LOCAL_MODULE_VAR:
case OpCode::STORE_MODULE_VAR:
case OpCode::STRING_FROM_SINGLE_CHAR_CODE:
case OpCode::ORDINARY_HAS_INSTANCE:
return VisitOthers(gate);
default:
return Circuit::NullGate();

View File

@ -188,6 +188,7 @@ group("ark_aot_ts_test") {
"optimization",
"optimized_call",
"or",
"ordinaryhasinstance",
"pgo_call",
"pgo_call_js",
"pgo_class_operation",

View File

@ -0,0 +1,18 @@
# Copyright (c) 2022 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("ordinaryhasinstance") {
deps = []
}

View File

@ -0,0 +1,12 @@
# Copyright (c) 2022 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.

View File

@ -0,0 +1,25 @@
/*
* Copyright (c) 2022 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.
*/
class Matrix {
static isMatrix(value: Matrix): boolean {
return value !== null && value instanceof Matrix;
}
}
let trainingSet: Matrix = new Matrix();
for (let i = 0; i < 1000; i++) {
Matrix.isMatrix(trainingSet);
}