From f397b014339aacc7c16b207080bd835d61dcf4f7 Mon Sep 17 00:00:00 2001 From: yangliping Date: Thu, 28 Aug 2025 16:47:33 +0800 Subject: [PATCH] revert "fix: too early lower ADD IR" Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/ICV9OX?from=project-issue Signed-off-by: yangliping --- ecmascript/compiler/circuit_builder.h | 4 +-- ecmascript/compiler/mcr_circuit_builder.cpp | 16 ++++++------ ecmascript/compiler/mcr_opcodes.h | 10 ++++---- .../compiler/native_inline_lowering.cpp | 14 +++++------ .../compiler/number_speculative_retype.cpp | 25 ++----------------- .../compiler/number_speculative_retype.h | 1 - .../compiler/typed_native_inline_lowering.cpp | 16 ++---------- test/aottest/BUILD.gn | 3 --- test/aottest/string_slice/BUILD.gn | 22 ---------------- test/aottest/string_slice/expect_output.txt | 15 ----------- .../string_slice/pgo_expect_output.txt | 15 ----------- test/aottest/string_slice/string_slice.ts | 23 ----------------- test/aottest/string_sub_str/BUILD.gn | 22 ---------------- test/aottest/string_sub_str/expect_output.txt | 15 ----------- .../string_sub_str/pgo_expect_output.txt | 15 ----------- test/aottest/string_sub_str/string_sub_str.ts | 23 ----------------- test/aottest/string_sub_string/BUILD.gn | 22 ---------------- .../string_sub_string/expect_output.txt | 15 ----------- .../string_sub_string/pgo_expect_output.txt | 15 ----------- .../string_sub_string/string_sub_string.ts | 23 ----------------- 20 files changed, 24 insertions(+), 290 deletions(-) delete mode 100644 test/aottest/string_slice/BUILD.gn delete mode 100644 test/aottest/string_slice/expect_output.txt delete mode 100644 test/aottest/string_slice/pgo_expect_output.txt delete mode 100644 test/aottest/string_slice/string_slice.ts delete mode 100644 test/aottest/string_sub_str/BUILD.gn delete mode 100644 test/aottest/string_sub_str/expect_output.txt delete mode 100644 test/aottest/string_sub_str/pgo_expect_output.txt delete mode 100644 test/aottest/string_sub_str/string_sub_str.ts delete mode 100644 test/aottest/string_sub_string/BUILD.gn delete mode 100644 test/aottest/string_sub_string/expect_output.txt delete mode 100644 test/aottest/string_sub_string/pgo_expect_output.txt delete mode 100644 test/aottest/string_sub_string/string_sub_string.ts diff --git a/ecmascript/compiler/circuit_builder.h b/ecmascript/compiler/circuit_builder.h index 6b6a8196cd..9e3ac7daf1 100644 --- a/ecmascript/compiler/circuit_builder.h +++ b/ecmascript/compiler/circuit_builder.h @@ -885,9 +885,9 @@ public: void SetRawHashcode(GateRef glue, GateRef str, GateRef rawHashcode); GateRef StringFromSingleCharCode(GateRef gate); GateRef StringCharCodeAt(GateRef thisValue, GateRef posTag); - GateRef StringSubstring(std::vector& args); + GateRef StringSubstring(GateRef thisValue, GateRef startTag, GateRef endTag); GateRef StringSubStr(GateRef thisValue, GateRef intStart, GateRef lengthTag); - GateRef StringSlice(std::vector& args); + GateRef StringSlice(GateRef thisValue, GateRef startTag, GateRef endTag); GateRef NumberIsNaN(GateRef gate); GateRef NumberParseFloat(GateRef gate, GateRef frameState); GateRef NumberParseInt(GateRef gate, GateRef radix); diff --git a/ecmascript/compiler/mcr_circuit_builder.cpp b/ecmascript/compiler/mcr_circuit_builder.cpp index 171f40afb5..920185ec3c 100644 --- a/ecmascript/compiler/mcr_circuit_builder.cpp +++ b/ecmascript/compiler/mcr_circuit_builder.cpp @@ -1818,15 +1818,14 @@ GateRef CircuitBuilder::StringCharCodeAt(GateRef thisValue, GateRef posTag) return ret; } -GateRef CircuitBuilder::StringSubstring(std::vector& args) +GateRef CircuitBuilder::StringSubstring(GateRef thisValue, GateRef startTag, GateRef endTag) { auto currentLabel = env_->GetCurrentLabel(); auto currentControl = currentLabel->GetControl(); auto currentDepend = currentLabel->GetDepend(); - std::vector inList {currentControl, currentDepend}; - inList.insert(inList.end(), args.begin(), args.end()); - GateRef ret = GetCircuit()->NewGate( - circuit_->StringSubstring(args.size()), MachineType::I64, inList, GateType::AnyType()); + GateRef ret = + GetCircuit()->NewGate(circuit_->StringSubstring(), MachineType::I64, + { currentControl, currentDepend, thisValue, startTag, endTag }, GateType::AnyType()); currentLabel->SetControl(ret); currentLabel->SetDepend(ret); return ret; @@ -1845,15 +1844,14 @@ GateRef CircuitBuilder::StringSubStr(GateRef thisValue, GateRef intStart, GateRe return ret; } -GateRef CircuitBuilder::StringSlice(std::vector& args) +GateRef CircuitBuilder::StringSlice(GateRef thisValue, GateRef startTag, GateRef endTag) { auto currentLabel = env_->GetCurrentLabel(); auto currentControl = currentLabel->GetControl(); auto currentDepend = currentLabel->GetDepend(); - std::vector inList {currentControl, currentDepend}; - inList.insert(inList.end(), args.begin(), args.end()); GateRef ret = - GetCircuit()->NewGate(circuit_->StringSlice(args.size()), MachineType::I64, inList, GateType::AnyType()); + GetCircuit()->NewGate(circuit_->StringSlice(), MachineType::I64, + { currentControl, currentDepend, thisValue, startTag, endTag }, GateType::AnyType()); currentLabel->SetControl(ret); currentLabel->SetDepend(ret); return ret; diff --git a/ecmascript/compiler/mcr_opcodes.h b/ecmascript/compiler/mcr_opcodes.h index 7ef0431f99..0e8265d394 100644 --- a/ecmascript/compiler/mcr_opcodes.h +++ b/ecmascript/compiler/mcr_opcodes.h @@ -67,7 +67,9 @@ namespace panda::ecmascript::kungfu { V(MonoLoadPropertyOnProto, MONO_LOAD_PROPERTY_ON_PROTO, GateFlags::CHECKABLE, 1, 1, 4) \ V(StringFromSingleCharCode, STRING_FROM_SINGLE_CHAR_CODE, GateFlags::NO_WRITE, 1, 1, 1) \ V(StringCharCodeAt, STRING_CHAR_CODE_AT, GateFlags::NO_WRITE, 1, 1, 2) \ + V(StringSubstring, STRING_SUB_STRING, GateFlags::NO_WRITE, 1, 1, 3) \ V(StringSubStr, STRING_SUB_STR, GateFlags::NO_WRITE, 1, 1, 3) \ + V(StringSlice, STRING_SLICE, GateFlags::NO_WRITE, 1, 1, 3) \ V(TypedArrayEntries, TYPED_ARRAY_ENTRIES, GateFlags::NO_WRITE, 1, 1, 1) \ V(TypedArrayKeys, TYPED_ARRAY_KEYS, GateFlags::NO_WRITE, 1, 1, 1) \ V(TypedArrayValues, TYPED_ARRAY_VALUES, GateFlags::NO_WRITE, 1, 1, 1) \ @@ -243,11 +245,9 @@ namespace panda::ecmascript::kungfu { MCR_GATE_META_DATA_LIST_WITH_VALUE(V) \ MCR_GATE_META_DATA_LIST_WITH_GATE_TYPE(V) -#define MCR_GATE_META_DATA_LIST_WITH_VALUE_IN(V) \ - V(StringSlice, STRING_SLICE, GateFlags::NO_WRITE, 1, 1, value) \ - V(StringSubstring, STRING_SUB_STRING, GateFlags::NO_WRITE, 1, 1, value) \ - V(TypedCreateObjWithBuffer, TYPED_CREATE_OBJ_WITH_BUFFER, GateFlags::CHECKABLE, 1, 1, value) \ - V(TypedCallCheck, TYPED_CALL_CHECK, GateFlags::CHECKABLE, 1, 1, value) \ +#define MCR_GATE_META_DATA_LIST_WITH_VALUE_IN(V) \ + V(TypedCreateObjWithBuffer, TYPED_CREATE_OBJ_WITH_BUFFER, GateFlags::CHECKABLE, 1, 1, value) \ + V(TypedCallCheck, TYPED_CALL_CHECK, GateFlags::CHECKABLE, 1, 1, value) \ V(FunctionPrototypeCall, FUNCTION_PROTOTYPE_CALL, GateFlags::NONE_FLAG, 1, 1, value) #define MCR_GATE_META_DATA_LIST_WITH_SIZE(V) \ diff --git a/ecmascript/compiler/native_inline_lowering.cpp b/ecmascript/compiler/native_inline_lowering.cpp index 9e743000f9..b9abc17edd 100644 --- a/ecmascript/compiler/native_inline_lowering.cpp +++ b/ecmascript/compiler/native_inline_lowering.cpp @@ -448,6 +448,7 @@ void NativeInlineLowering::TryInlineStringSubstring(GateRef gate, size_t argc, b CallThis1TypeInfoAccessor tacc(compilationEnv_, circuit_, gate); GateRef thisValue = acc_.GetValueIn(gate, 0); GateRef startTag = tacc.GetArg0(); + GateRef endTag = builder_.GetLengthFromString(thisValue); if (!Uncheck()) { builder_.CallTargetCheck(gate, tacc.GetFunc(), builder_.IntPtr(static_cast(BuiltinsStubCSigns::ID::StringSubstring)), @@ -456,8 +457,7 @@ void NativeInlineLowering::TryInlineStringSubstring(GateRef gate, size_t argc, b auto param_check = builder_.TaggedIsNumber(startTag); builder_.DeoptCheck(param_check, acc_.GetFrameState(gate), DeoptType::BUILTIN_INLINING_TYPE_GUARD); } - std::vector args {thisValue, startTag}; - ret = builder_.StringSubstring(args); + ret = builder_.StringSubstring(thisValue, startTag, endTag); } else { GateRef thisValue = acc_.GetValueIn(gate, 0); GateRef startTag = acc_.GetValueIn(gate, 1); @@ -471,8 +471,7 @@ void NativeInlineLowering::TryInlineStringSubstring(GateRef gate, size_t argc, b .And(builder_.TaggedIsNumber(endTag)).Done(); builder_.DeoptCheck(param_check, acc_.GetFrameState(gate), DeoptType::BUILTIN_INLINING_TYPE_GUARD); } - std::vector args {thisValue, startTag, endTag}; - ret = builder_.StringSubstring(args); + ret = builder_.StringSubstring(thisValue, startTag, endTag); } acc_.ReplaceHirAndDeleteIfException(gate, builder_.GetStateDepend(), ret); } @@ -533,6 +532,7 @@ void NativeInlineLowering::TryInlineStringSlice(GateRef gate, size_t argc, bool CallThis1TypeInfoAccessor tacc(compilationEnv_, circuit_, gate); GateRef thisValue = acc_.GetValueIn(gate, 0); GateRef startTag = tacc.GetArg0(); + GateRef endTag = builder_.GetLengthFromString(thisValue); if (!Uncheck()) { builder_.CallTargetCheck(gate, tacc.GetFunc(), builder_.IntPtr(static_cast(BuiltinsStubCSigns::ID::StringSlice)), @@ -541,8 +541,7 @@ void NativeInlineLowering::TryInlineStringSlice(GateRef gate, size_t argc, bool auto param_check = builder_.TaggedIsNumber(startTag); builder_.DeoptCheck(param_check, acc_.GetFrameState(gate), DeoptType::BUILTIN_INLINING_TYPE_GUARD); } - std::vector args {thisValue, startTag}; - ret = builder_.StringSlice(args); + ret = builder_.StringSlice(thisValue, startTag, endTag); } else { GateRef thisValue = acc_.GetValueIn(gate, 0); GateRef startTag = acc_.GetValueIn(gate, 1); @@ -556,8 +555,7 @@ void NativeInlineLowering::TryInlineStringSlice(GateRef gate, size_t argc, bool .And(builder_.TaggedIsNumber(endTag)).Done(); builder_.DeoptCheck(param_check, acc_.GetFrameState(gate), DeoptType::BUILTIN_INLINING_TYPE_GUARD); } - std::vector args {thisValue, startTag, endTag}; - ret = builder_.StringSlice(args); + ret = builder_.StringSlice(thisValue, startTag, endTag); } acc_.ReplaceHirAndDeleteIfException(gate, builder_.GetStateDepend(), ret); } diff --git a/ecmascript/compiler/number_speculative_retype.cpp b/ecmascript/compiler/number_speculative_retype.cpp index f8c2125ec1..5567527741 100644 --- a/ecmascript/compiler/number_speculative_retype.cpp +++ b/ecmascript/compiler/number_speculative_retype.cpp @@ -275,11 +275,10 @@ GateRef NumberSpeculativeRetype::VisitGate(GateRef gate) case OpCode::MAP_ENTRIES: case OpCode::SET_ENTRIES: case OpCode::SET_VALUES: - return VisitOthersWithoutConvert(gate); + case OpCode::STRING_SLICE: case OpCode::STRING_SUB_STR: case OpCode::STRING_SUB_STRING: - case OpCode::STRING_SLICE: - return VisitString(gate); + return VisitOthersWithoutConvert(gate); case OpCode::ARRAY_INCLUDES_INDEXOF: return VisitArrayIncludesIndexOf(gate); case OpCode::STRING_CHAR_CODE_AT: @@ -2247,26 +2246,6 @@ GateRef NumberSpeculativeRetype::VisitStringCharCodeAt(GateRef gate) return Circuit::NullGate(); } -GateRef NumberSpeculativeRetype::VisitString(GateRef gate) -{ - Environment env(gate, circuit_, &builder_); - if (IsRetype()) { - return SetOutputType(gate, GateType::AnyType()); - } - if (IsConvert()) { - GateRef thisValue = acc_.GetValueIn(gate, 0); - acc_.ReplaceValueIn(gate, ConvertToTagged(thisValue), 0); - auto argc = acc_.GetNumValueIn(gate); - for (size_t i = 1; i < argc; i++) { - GateRef arg = acc_.GetValueIn(gate, i); - acc_.ReplaceValueIn(gate, CheckAndConvertToInt32(arg, GateType::IntType()), i); - } - acc_.ReplaceStateIn(gate, builder_.GetState()); - acc_.ReplaceDependIn(gate, builder_.GetDepend()); - } - return Circuit::NullGate(); -} - GateRef NumberSpeculativeRetype::VisitMonoLoadPropertyOnProto(GateRef gate) { if (IsRetype()) { diff --git a/ecmascript/compiler/number_speculative_retype.h b/ecmascript/compiler/number_speculative_retype.h index fb77ac9c28..9a8293d6a3 100644 --- a/ecmascript/compiler/number_speculative_retype.h +++ b/ecmascript/compiler/number_speculative_retype.h @@ -137,7 +137,6 @@ private: GateRef VisitDateNow(GateRef gate); GateRef VisitArrayIncludesIndexOf(GateRef gate); GateRef VisitStringCharCodeAt(GateRef gate); - GateRef VisitString(GateRef gate); void ConvertForNumberBinaryOp(GateRef gate); void ConvertForNumberCompareOp(GateRef gate); diff --git a/ecmascript/compiler/typed_native_inline_lowering.cpp b/ecmascript/compiler/typed_native_inline_lowering.cpp index 271cb2844b..826fafa189 100644 --- a/ecmascript/compiler/typed_native_inline_lowering.cpp +++ b/ecmascript/compiler/typed_native_inline_lowering.cpp @@ -2172,13 +2172,7 @@ void TypedNativeInlineLowering::LowerStringSubstring(GateRef gate) GateRef thisValue = acc_.GetValueIn(gate, 0); // 0: the first parameter GateRef startTag = acc_.GetValueIn(gate, 1); // 1: the second parameter - auto argc = acc_.GetNumValueIn(gate); - GateRef endTag; - if (argc < 3) { // 3: the 2nd parameter of substring is optional - endTag = builder_.GetLengthFromString(thisValue); - } else { - endTag = acc_.GetValueIn(gate, 2); // 2: the third parameter - } + GateRef endTag = acc_.GetValueIn(gate, 2); // 2: the third parameter GateRef glue = glue_; DEFVALUE(result, (&builder_), VariableType::JS_POINTER(), builder_.Int32ToTaggedPtr(builder_.Int32(-1))); DEFVALUE(start, (&builder_), VariableType::INT32(), builder_.Int32(0)); @@ -2335,13 +2329,7 @@ void TypedNativeInlineLowering::LowerStringSlice(GateRef gate) GateRef thisValue = acc_.GetValueIn(gate, 0); // 0: the first parameter GateRef startTag = acc_.GetValueIn(gate, 1); // 1: the second parameter - auto argc = acc_.GetNumValueIn(gate); - GateRef endTag; - if (argc < 3) { // 3: the 2nd parameter of slice is optional - endTag = builder_.GetLengthFromString(thisValue); - } else { - endTag = acc_.GetValueIn(gate, 2); // 2: the third parameter - } + GateRef endTag = acc_.GetValueIn(gate, 2); // 2: the third parameter GateRef glue = glue_; DEFVALUE(result, (&builder_), VariableType::JS_POINTER(), builder_.Undefined()); DEFVALUE(start, (&builder_), VariableType::INT32(), builder_.Int32(0)); diff --git a/test/aottest/BUILD.gn b/test/aottest/BUILD.gn index 0569de7979..b7c80611ed 100644 --- a/test/aottest/BUILD.gn +++ b/test/aottest/BUILD.gn @@ -331,9 +331,6 @@ group("ark_aot_ts_test") { "string_equal", "string_inline", "string_localecompare", - "string_slice", - "string_sub_string", - "string_sub_str", "stsuperbyname", "sub", "supercall", diff --git a/test/aottest/string_slice/BUILD.gn b/test/aottest/string_slice/BUILD.gn deleted file mode 100644 index 2978fbdb44..0000000000 --- a/test/aottest/string_slice/BUILD.gn +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2025 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("string_slice") { - deps = [] - is_enable_pgo = true - is_enable_enableArkTools = true - is_enable_opt_inlining = true - is_enable_native_inline = true -} diff --git a/test/aottest/string_slice/expect_output.txt b/test/aottest/string_slice/expect_output.txt deleted file mode 100644 index 8270899b28..0000000000 --- a/test/aottest/string_slice/expect_output.txt +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2025 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 -a diff --git a/test/aottest/string_slice/pgo_expect_output.txt b/test/aottest/string_slice/pgo_expect_output.txt deleted file mode 100644 index e0b3f928c3..0000000000 --- a/test/aottest/string_slice/pgo_expect_output.txt +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2025 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 -a diff --git a/test/aottest/string_slice/string_slice.ts b/test/aottest/string_slice/string_slice.ts deleted file mode 100644 index 7692a899d1..0000000000 --- a/test/aottest/string_slice/string_slice.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -// @ts-nocheck -function foo() { - let a = "a"; - let b = a[0]; - let c = b.slice(0); - print(c); -} -print(ArkTools.isAOTCompiled(foo)); -foo(); diff --git a/test/aottest/string_sub_str/BUILD.gn b/test/aottest/string_sub_str/BUILD.gn deleted file mode 100644 index fad881d1d4..0000000000 --- a/test/aottest/string_sub_str/BUILD.gn +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2025 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("string_sub_str") { - deps = [] - is_enable_pgo = true - is_enable_enableArkTools = true - is_enable_opt_inlining = true - is_enable_native_inline = true -} diff --git a/test/aottest/string_sub_str/expect_output.txt b/test/aottest/string_sub_str/expect_output.txt deleted file mode 100644 index 8270899b28..0000000000 --- a/test/aottest/string_sub_str/expect_output.txt +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2025 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 -a diff --git a/test/aottest/string_sub_str/pgo_expect_output.txt b/test/aottest/string_sub_str/pgo_expect_output.txt deleted file mode 100644 index e0b3f928c3..0000000000 --- a/test/aottest/string_sub_str/pgo_expect_output.txt +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2025 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 -a diff --git a/test/aottest/string_sub_str/string_sub_str.ts b/test/aottest/string_sub_str/string_sub_str.ts deleted file mode 100644 index 2aaff72ea9..0000000000 --- a/test/aottest/string_sub_str/string_sub_str.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -// @ts-nocheck -function foo() { - let a = "a"; - let b = a[0]; - let c = b.substr(0); - print(c); -} -print(ArkTools.isAOTCompiled(foo)); -foo(); diff --git a/test/aottest/string_sub_string/BUILD.gn b/test/aottest/string_sub_string/BUILD.gn deleted file mode 100644 index 606f8e2de1..0000000000 --- a/test/aottest/string_sub_string/BUILD.gn +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2025 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("string_sub_string") { - deps = [] - is_enable_pgo = true - is_enable_enableArkTools = true - is_enable_opt_inlining = true - is_enable_native_inline = true -} diff --git a/test/aottest/string_sub_string/expect_output.txt b/test/aottest/string_sub_string/expect_output.txt deleted file mode 100644 index 8270899b28..0000000000 --- a/test/aottest/string_sub_string/expect_output.txt +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2025 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 -a diff --git a/test/aottest/string_sub_string/pgo_expect_output.txt b/test/aottest/string_sub_string/pgo_expect_output.txt deleted file mode 100644 index e0b3f928c3..0000000000 --- a/test/aottest/string_sub_string/pgo_expect_output.txt +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2025 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 -a diff --git a/test/aottest/string_sub_string/string_sub_string.ts b/test/aottest/string_sub_string/string_sub_string.ts deleted file mode 100644 index 59d2f15ced..0000000000 --- a/test/aottest/string_sub_string/string_sub_string.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -// @ts-nocheck -function foo() { - let a = "a"; - let b = a[0]; - let c = b.substring(0); - print(c); -} -print(ArkTools.isAOTCompiled(foo)); -foo(); -- Gitee