From 84e5acef93991b1ff33e67defeff104ab68763e9 Mon Sep 17 00:00:00 2001 From: Howard Roark Date: Tue, 29 Oct 2024 17:20:30 +0300 Subject: [PATCH 1/6] Implement String.fromCharCode() as intrinsic The patch implements the fromCharCode() method as an intrinsic using IrToc. Issue: https://gitee.com/openharmony/arkcompiler_runtime_core/issues/IB33BS Test: build Signed-off-by: Howard Roark --- static_core/irtoc/intrinsics.yaml | 6 - static_core/irtoc/scripts/string_helpers.irt | 2 +- .../ets/compiler/codegen_intrinsics_ets.cpp | 19 +++ .../plugins/ets/irtoc_scripts/string.irt | 139 ++++++++++++++++++ .../ets_llvm_ir_constructor_gen.inl | 12 ++ .../ets_llvm_ir_constructor_h_gen.inl | 1 + .../plugins/ets/runtime/ets_entrypoints.cpp | 6 + .../plugins/ets/runtime/ets_entrypoints.yaml | 34 +++++ .../ets/runtime/ets_libbase_runtime.yaml | 17 +++ .../runtime/intrinsics/std_core_String.cpp | 6 + .../plugins/ets/runtime/types/ets_string.h | 43 ++++++ .../plugins/ets/stdlib/std/core/String.sts | 8 +- .../ets_test_suite/intrinsics/CMakeLists.txt | 4 + .../intrinsics/string_from_char_code.sts | 93 ++++++++++++ .../string_from_char_code_escape.sts | 21 +++ .../tests/runtime/types/ets_string_test.cpp | 76 ++++++++++ 16 files changed, 473 insertions(+), 14 deletions(-) create mode 100644 static_core/plugins/ets/tests/ets_test_suite/intrinsics/string_from_char_code.sts create mode 100644 static_core/plugins/ets/tests/ets_test_suite/intrinsics/string_from_char_code_escape.sts diff --git a/static_core/irtoc/intrinsics.yaml b/static_core/irtoc/intrinsics.yaml index f0938e235..ec5f5b1c9 100644 --- a/static_core/irtoc/intrinsics.yaml +++ b/static_core/irtoc/intrinsics.yaml @@ -349,9 +349,6 @@ intrinsics: signature: ret: void* args: [ u16, u16* ] - signature: - ret: void - args: [] description: Find u16 char in 32-byte block of memory addressed by the second operand - name: MemCharU16X8UsingSimd @@ -368,7 +365,4 @@ intrinsics: signature: ret: void* args: [ u16, u16* ] - signature: - ret: void - args: [] description: Find u16 char in 16-byte block of memory addressed by the second operand diff --git a/static_core/irtoc/scripts/string_helpers.irt b/static_core/irtoc/scripts/string_helpers.irt index c29f1a6f9..c5b625c3d 100644 --- a/static_core/irtoc/scripts/string_helpers.irt +++ b/static_core/irtoc/scripts/string_helpers.irt @@ -367,7 +367,7 @@ end # def GenerateCreateStringFromStringTlab ### # Checks if starting from arr_data the specified number of chars (char_count) can be compressed # -# Utf16 char is ASCII if (uft16_char - 1U < utf::UTF8_1B_MAX) +# Utf16 char is ASCII if (utf16_char - 1U < utf::UTF8_1B_MAX) # See runtime/include/coretypes/string.h - IsASCIICharacter # scoped_macro(:is_array_of_compressable_chars) do |arr_data, char_count| diff --git a/static_core/plugins/ets/compiler/codegen_intrinsics_ets.cpp b/static_core/plugins/ets/compiler/codegen_intrinsics_ets.cpp index 5535a1db8..361ed65ee 100644 --- a/static_core/plugins/ets/compiler/codegen_intrinsics_ets.cpp +++ b/static_core/plugins/ets/compiler/codegen_intrinsics_ets.cpp @@ -534,4 +534,23 @@ void Codegen::CreateStringIndexOfAfter(IntrinsicInst *inst, Reg dst, SRCREGS src enc->BindLabel(charNotFoundLabel); } +void Codegen::CreateStringFromCharCode(IntrinsicInst *inst, Reg dst, SRCREGS src) +{ + ASSERT(GetArch() != Arch::AARCH32); + auto array = src[FIRST_OPERAND]; + auto entryId = GetRuntime()->IsCompressedStringsEnabled() ? EntrypointId::STRING_FROM_CHAR_CODE_TLAB_COMPRESSED + : EntrypointId::STRING_FROM_CHAR_CODE_TLAB; + if (GetGraph()->IsAotMode()) { + ScopedTmpReg klassReg(GetEncoder()); + GetEncoder()->EncodeLdr( + klassReg, false, + MemRef(ThreadReg(), static_cast(GetRuntime()->GetStringClassPointerTlsOffset(GetArch())))); + CallFastPath(inst, entryId, dst, RegMask::GetZeroMask(), array, klassReg); + } else { + auto klassImm = + TypedImm(reinterpret_cast(GetRuntime()->GetStringClass(GetGraph()->GetMethod(), nullptr))); + CallFastPath(inst, entryId, dst, RegMask::GetZeroMask(), array, klassImm); + } +} + } // namespace ark::compiler diff --git a/static_core/plugins/ets/irtoc_scripts/string.irt b/static_core/plugins/ets/irtoc_scripts/string.irt index d8356784d..f75d256a8 100644 --- a/static_core/plugins/ets/irtoc_scripts/string.irt +++ b/static_core/plugins/ets/irtoc_scripts/string.irt @@ -837,6 +837,145 @@ function(:StringGetBytesTlab, Intrinsic(:UNREACHABLE).Terminator.void if defines.DEBUG } +### +# Loads a char code from codes_data by offset offset (in bytes) and converts it into +# a Utf16 char (u16) +scoped_macro(:load_char_from_code) do |codes_data, offset| + code := Load(codes_data, offset).f64 + infinity_i64 := Cast(0x7ff0000000000000).i64 + If(Bitcast(code).i64, infinity_i64).EQ.Unlikely.b { + char1 := Cast(0).u16 + Goto(:LoadCharFromCodeEnd) + } + char2 := AndI(Cast(code).i64).Imm(0xffff).u16 +Label(:LoadCharFromCodeEnd) + char := Phi(char1, char2).u16 +end # load_char_from_code + +### +# Checks if starting from codes_data the specified number of codes (codes_count) represent +# an array of compressable chars +# +# Utf16 char is ASCII if (utf16_char - 1U < utf::UTF8_1B_MAX) +# See runtime/include/coretypes/string.h - IsASCIICharacter +# +scoped_macro(:is_array_of_compressable_char_codes) do |codes_data, codes_count| + i1 := Cast(0).u64 + codes_len := ShlI(codes_count).Imm(3).u64 + compressable1 := Cast(1).b +Label(:CompressableCodesLoop) + i := Phi(i1, i2).u64 + If(i, codes_len).AE.Unlikely.b { + Goto(:CompressableCodesLoopDone) + } + char := load_char_from_code(codes_data, i) + If(SubI(char).Imm(1).u16, Cast(Constants::STRING_MUTF8_1B_MAX).u16).AE.Unlikely.b { + compressable2 := Cast(0).b + Goto(:CompressableCodesLoopDone) + } + i2 := AddI(i).Imm(8).u64 + Goto(:CompressableCodesLoop) + +Label(:CompressableCodesLoopDone) + compressable := Phi(compressable1, compressable2).b +end # is_array_of_compressable_char_codes + +### +# Convert char codes (numbers) to chars with type equals either to "u8" or "u16" depending +# on the given compressed_string argument, respectively. For type equals to "u8", it is +# assumed that all char codes represent compressable chars. +# +def GenerateConvertCharCodesToChars(compressed_string) + type = (compressed_string ? "u8" : "u16") + scoped_macro("convert_char_codes_to_#{type}_chars".to_sym) do |src, dst, count| + i1 := Cast(0).u64 +Label(:ConvertLoop) + i := Phi(i1, i2).u64 + If(i, count).AE.Unlikely.b { + Goto(:End) + } + code_offset := ShlI(i).Imm(3).u64 + char := load_char_from_code(src, code_offset) + if compressed_string + char_offset := Cast(i).u64 + Store(dst, char_offset, char).u8 + else + char_offset := ShlI(i).Imm(1).u64 + Store(dst, char_offset, char).u16 + end + i2 := AddI(i).Imm(1).u64 + Goto(:ConvertLoop) + + Label(:End) + end # convert_char_codes_to_chars +end # def GenerateConvertCharCodesToChars + +GenerateConvertCharCodesToChars(compressed_string=true) +GenerateConvertCharCodesToChars(compressed_string=false) + +def GenerateStringFromCharCodeTlab(string_compression_enabled) + suffix = (string_compression_enabled ? "Compressed" : "") + available_regs = $panda_mask + function("StringFromCharCodeTlab#{suffix}".to_sym, + params: {char_codes: 'ref', string_klass: 'ref'}, + regmap: $full_regmap, + regalloc_set: available_regs, + mode: [:FastPath]) { + + if Options.arch == :arm32 + Intrinsic(:UNREACHABLE).Terminator.void + ReturnVoid().void + next + end + + # There is no check of the arguments against NullPointer as + # it's done in the InstBuilder (see AddArgNullcheckIfNeeded) for non-empty arrays + # and we suppose that the `NewArray (size=0)` instruction never returns `null`. + codes_data := Add(Cast(char_codes).SrcType(Constants::COMPILER_REFERENCE).ptr, Cast(Constants::ARRAY_DATA_OFFSET).u64).ptr + codes_count := LoadI(char_codes).Imm(Constants::ARRAY_LENGTH_OFFSET).u32 + + # Allocate a new string + if string_compression_enabled + compressable := is_array_of_compressable_char_codes(codes_data, Cast(codes_count).u64) + If(compressable, 1).EQ.Likely.b { + data_size1 := Cast(codes_count).word + } Else { + data_size2 := Cast(ShlI(codes_count).Imm(1).u32).word + } + data_size := Phi(data_size1, data_size2).word + else + data_size := Cast(ShlI(codes_count).Imm(1).u32).word + end + new_str := allocate_string_tlab(string_klass, data_size) + str_data := Add(new_str, Cast(Constants::STRING_DATA_OFFSET).u64).ptr + + # Copy data from char_codes to the new string with the required preprocessing + # String length field is set according to SetLength() from runtime/include/coretypes/string.h + if string_compression_enabled + If(compressable, 1).EQ.Likely.b { + convert_char_codes_to_u8_chars(codes_data, str_data, Cast(codes_count).u64) + StoreI(new_str, ShlI(codes_count).Imm(1).u32).Imm(Constants::STRING_LENGTH_OFFSET).u32 + } Else { + convert_char_codes_to_u16_chars(codes_data, str_data, Cast(codes_count).u64) + StoreI(new_str, OrI(ShlI(codes_count).Imm(1).u32).Imm(1).u32).Imm(Constants::STRING_LENGTH_OFFSET).u32 + } + else + convert_char_codes_to_u16_chars(codes_data, str_data, Cast(codes_count).u64) + StoreI(new_str, codes_count).Imm(Constants::STRING_LENGTH_OFFSET).u32 + end + # String is supposed to be a constant object, so all its data should be visible by all threads + Intrinsic(:DATA_MEMORY_BARRIER_FULL).void + Return(new_str).ptr + + Label(:SlowPathEntrypoint) + entrypoint = get_entrypoint_offset("STRING_FROM_CHAR_CODE_SLOW_PATH") + Intrinsic(:SLOW_PATH_ENTRY, char_codes).AddImm(entrypoint).MethodAsImm("StringFromCharCode2ArgBridge").Terminator.ptr + Intrinsic(:UNREACHABLE).Terminator.void if defines.DEBUG + } +end # def GenerateStringFromCharCodeTlab + +GenerateStringFromCharCodeTlab(string_compression_enabled=true) +GenerateStringFromCharCodeTlab(string_compression_enabled=false) # String contains 8-bit chars # 0 < str_data_size < 8 diff --git a/static_core/plugins/ets/libllvmbackend/ets_llvm_ir_constructor_gen.inl b/static_core/plugins/ets/libllvmbackend/ets_llvm_ir_constructor_gen.inl index 79305121e..4b2340e33 100644 --- a/static_core/plugins/ets/libllvmbackend/ets_llvm_ir_constructor_gen.inl +++ b/static_core/plugins/ets/libllvmbackend/ets_llvm_ir_constructor_gen.inl @@ -412,3 +412,15 @@ bool LLVMIrConstructor::EmitStringIndexOfAfter(Inst *inst) ValueMapAdd(inst, charIndex); return true; } + +bool LLVMIrConstructor::EmitStringFromCharCode(Inst *inst) +{ + ASSERT(GetGraph()->GetRuntime()->IsCompressedStringsEnabled()); + auto entryId = RuntimeInterface::EntrypointId::STRING_FROM_CHAR_CODE_TLAB_COMPRESSED; + auto klassOffset = GetGraph()->GetRuntime()->GetStringClassPointerTlsOffset(GetGraph()->GetArch()); + auto klass = llvmbackend::runtime_calls::LoadTLSValue(&builder_, arkInterface_, klassOffset, builder_.getPtrTy()); + auto call = CreateFastPathCall(inst, entryId, {GetInputValue(inst, 0), klass}); + MarkAsAllocation(call); + ValueMapAdd(inst, call); + return true; +} diff --git a/static_core/plugins/ets/libllvmbackend/ets_llvm_ir_constructor_h_gen.inl b/static_core/plugins/ets/libllvmbackend/ets_llvm_ir_constructor_h_gen.inl index 29a7ee667..1216dd260 100644 --- a/static_core/plugins/ets/libllvmbackend/ets_llvm_ir_constructor_h_gen.inl +++ b/static_core/plugins/ets/libllvmbackend/ets_llvm_ir_constructor_h_gen.inl @@ -42,3 +42,4 @@ bool EmitStringEndsWith(Inst *inst); bool EmitStringGetBytesTlab(Inst *inst); bool EmitStringIndexOf(Inst *inst); bool EmitStringIndexOfAfter(Inst *inst); +bool EmitStringFromCharCode(Inst *inst); diff --git a/static_core/plugins/ets/runtime/ets_entrypoints.cpp b/static_core/plugins/ets/runtime/ets_entrypoints.cpp index 0990409f0..3a902f41a 100644 --- a/static_core/plugins/ets/runtime/ets_entrypoints.cpp +++ b/static_core/plugins/ets/runtime/ets_entrypoints.cpp @@ -355,4 +355,10 @@ extern "C" ObjectHeader *DoubleToStringDecimalNoCacheEntrypoint(uint64_t number) return DoubleToStringCache::GetNoCache(bit_cast(number))->GetCoreType(); } +extern "C" coretypes::String *StringFromCharCodeEntrypoint(ObjectHeader *array) +{ + [[maybe_unused]] auto charCodes = reinterpret_cast(array); + return EtsString::CreateNewStringFromCharCode(charCodes)->GetCoreType(); +} + } // namespace ark::ets diff --git a/static_core/plugins/ets/runtime/ets_entrypoints.yaml b/static_core/plugins/ets/runtime/ets_entrypoints.yaml index 1648546d9..8c7740253 100644 --- a/static_core/plugins/ets/runtime/ets_entrypoints.yaml +++ b/static_core/plugins/ets/runtime/ets_entrypoints.yaml @@ -739,3 +739,37 @@ - void* # u16 string data ptr - uint32_t # string data size - uint16_t # char to look up + +- name: StringFromCharCodeTlab + entrypoint: StringFromCharCodeTlab + bridge: none + properties: [irtoc] + signature: + - ark::ObjectHeader* # string (result) + - ark::ObjectHeader* # array of numbers (f64) + - ark::Class* # string class pointer + +- name: StringFromCharCodeTlabCompressed + entrypoint: StringFromCharCodeTlabCompressed + bridge: none + properties: [irtoc] + signature: + - ark::ObjectHeader* # string (result) + - ark::ObjectHeader* # array of numbers (f64) + - ark::Class* # string class pointer + +- name: StringFromCharCodeSlowPath + entrypoint: StringFromCharCodeEntrypoint + bridge: slow_path + properties: [] + signature: + - ark::coretypes::String* # resulting string + - ark::ObjectHeader* # array of numbers (f64) + +- name: StringFromCharCode2Arg + entrypoint: StringFromCharCodeEntrypoint + bridge: odd_saved2 + properties: [] + signature: + - ark::coretypes::String* # resulting string + - ark::ObjectHeader* # array of numbers (f64) diff --git a/static_core/plugins/ets/runtime/ets_libbase_runtime.yaml b/static_core/plugins/ets/runtime/ets_libbase_runtime.yaml index 948a05767..610ce0fdd 100644 --- a/static_core/plugins/ets/runtime/ets_libbase_runtime.yaml +++ b/static_core/plugins/ets/runtime/ets_libbase_runtime.yaml @@ -57,6 +57,9 @@ coretypes: - managed_class: std.core.CondVar mirror_class: ark::ets::EtsCondVar +- managed_class: f64[] + mirror_class: ark::ets::EtsDoubleArray + intrinsics_namespace: ark::ets::intrinsics intrinsics: @@ -1068,6 +1071,20 @@ intrinsics: codegen_func: CreateStringEndsWith llvm_codegen_func: EmitStringEndsWith + - name: StdCoreStringFromCharCode + space: ets + class_name: std.core.String + method_name: fromCharCode + static: true + signature: + ret: std.core.String + args: + - f64[] + impl: ark::ets::intrinsics::StdCoreStringFromCharCode + codegen_arch: [ arm64, amd64 ] + codegen_func: CreateStringFromCharCode + llvm_codegen_func: EmitStringFromCharCode + ########################## # std.core.StringBuilder # ########################## diff --git a/static_core/plugins/ets/runtime/intrinsics/std_core_String.cpp b/static_core/plugins/ets/runtime/intrinsics/std_core_String.cpp index d24fc3be4..00bcf03e1 100644 --- a/static_core/plugins/ets/runtime/intrinsics/std_core_String.cpp +++ b/static_core/plugins/ets/runtime/intrinsics/std_core_String.cpp @@ -515,4 +515,10 @@ EtsBoolean StdCoreStringEndsWith(EtsString *thisStr, EtsString *suffix, EtsInt e return thisStr->EndsWith(suffix, endIndex); } +EtsString *StdCoreStringFromCharCode(EtsDoubleArray *charCodes) +{ + ASSERT(charCodes != nullptr); + return EtsString::CreateNewStringFromCharCode(charCodes); +} + } // namespace ark::ets::intrinsics diff --git a/static_core/plugins/ets/runtime/types/ets_string.h b/static_core/plugins/ets/runtime/types/ets_string.h index 042e937f3..4d7be313c 100644 --- a/static_core/plugins/ets/runtime/types/ets_string.h +++ b/static_core/plugins/ets/runtime/types/ets_string.h @@ -21,6 +21,7 @@ #include "plugins/ets/runtime/types/ets_array.h" #include "plugins/ets/runtime/types/ets_object.h" #include "plugins/ets/runtime/napi/ets_napi.h" +#include namespace ark::ets { @@ -101,6 +102,48 @@ public: return reinterpret_cast(s); } + static EtsString *CreateNewStringFromCharCode(EtsDoubleArray *charCodes) + { + const size_t length = charCodes->GetLength(); + if (length == 0) { + return CreateNewEmptyString(); + } + + auto codeToChar = [](double code) -> uint16_t { + constexpr double UTF16_CHAR_DIVIDER = 0x10000; + return static_cast(static_cast(std::fmod(code, UTF16_CHAR_DIVIDER))); + }; + + auto isCompressed = [codeToChar](EtsDoubleArray *codes) -> bool { + if (!Runtime::GetOptions().IsRuntimeCompressedStringsEnabled()) { + return false; + } + + for (size_t i = 0; i < codes->GetLength(); ++i) { + if (!IsASCIICharacter(codeToChar(codes->Get(i)))) { + return false; + } + } + return true; + }; + + auto copyCharsIntoString = [codeToChar](EtsDoubleArray *codes, auto *dstData) { + Span> to(dstData, codes->GetLength()); + for (size_t i = 0; i < codes->GetLength(); ++i) { + to[i] = codeToChar(codes->Get(i)); + } + }; + + bool compress = isCompressed(charCodes); + EtsString *s = AllocateNonInitializedString(length, compress); + if (compress) { + copyCharsIntoString(charCodes, s->GetDataMUtf8()); + } else { + copyCharsIntoString(charCodes, s->GetDataUtf16()); + } + return s; + } + static EtsString *CreateNewStringFromChars(uint32_t offset, uint32_t length, EtsArray *chararray) { ASSERT_HAVE_ACCESS_TO_MANAGED_OBJECTS(); diff --git a/static_core/plugins/ets/stdlib/std/core/String.sts b/static_core/plugins/ets/stdlib/std/core/String.sts index 292a86edf..06d7cc177 100644 --- a/static_core/plugins/ets/stdlib/std/core/String.sts +++ b/static_core/plugins/ets/stdlib/std/core/String.sts @@ -1215,13 +1215,7 @@ export final class String extends Object implements Comparable, JSONable * @returns string consisting of specified UTF-16 code units. * */ - public static fromCharCode(...codes: number[]): String { - let res = new StringBuilder(); - for (const cu of codes) { - res.append((cu % (0x10000)) as char) - } - return res.toString() - } + public static native fromCharCode(...codes: number[]): String; /* * The valueOf() method returns the primitive value of a String object. diff --git a/static_core/plugins/ets/tests/ets_test_suite/intrinsics/CMakeLists.txt b/static_core/plugins/ets/tests/ets_test_suite/intrinsics/CMakeLists.txt index a0c9f28ee..ea247a7fb 100644 --- a/static_core/plugins/ets/tests/ets_test_suite/intrinsics/CMakeLists.txt +++ b/static_core/plugins/ets/tests/ets_test_suite/intrinsics/CMakeLists.txt @@ -29,6 +29,7 @@ set(intrinsics_tests string_trim string_startswith string_endswith + string_from_char_code string_indexof char_isuppercase abs @@ -45,6 +46,9 @@ set(intrinsics_tests if (NOT PANDA_TARGET_ARM32) # need coroutine support list(APPEND intrinsics_tests to_string_cache) + + # need support for the 'escape' function + list(APPEND intrinsics_tests string_from_char_code_escape) endif() set(intrinsics_tests_in_dir "${CMAKE_CURRENT_SOURCE_DIR}") diff --git a/static_core/plugins/ets/tests/ets_test_suite/intrinsics/string_from_char_code.sts b/static_core/plugins/ets/tests/ets_test_suite/intrinsics/string_from_char_code.sts new file mode 100644 index 000000000..607e96c63 --- /dev/null +++ b/static_core/plugins/ets/tests/ets_test_suite/intrinsics/string_from_char_code.sts @@ -0,0 +1,93 @@ +/* + * 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 main(): int { + assert string.fromCharCode() == "" : "Error! Must be an empty string"; + assert string.fromCharCode().length == 0 : "Error! String length of an empty string must be equal to 0"; + assert string.fromCharCode(65.992 as number) == "A" : "Error! Must be 'A'"; + assert string.fromCharCode(65.992 as number).length == 1 : "Error! String length of 'A' must be equal to 1"; + assert string.fromCharCode(0x43 as number) == "C" : "Error! Must be 'C'"; + assert string.fromCharCode(0x3B2 as number) == "β" : "Error! Must be 'β'"; + assert string.fromCharCode(0x3B2 as number).length == 1 : "Error! String length of 'β' must be equal to 1"; + assert string.fromCharCode(0x103B2 as number) == "β" : "Error! Must be 'β'"; + assert string.fromCharCode(0x13B2 as number).length == 1 : "Error! String length of 'β' must be equal to 1"; + assert string.fromCharCode(0xD799 as number) == "힙" : "Error! Must be '힙'"; + assert string.fromCharCode(0xD799 as number).length == 1 : "Error! String length of '힙' must be equal to 1"; + assert string.fromCharCode(0x9 as number) == '\t' : "Error! Must be '\\t'"; + assert string.fromCharCode(0x9 as number).length == 1 : "Error! String length of '\\t' must be equal to 1"; + assert string.fromCharCode(0xA as number) == '\n' : "Error! Must be '\\n'"; + assert string.fromCharCode(0xA as number).length == 1 : "Error! String length of '\\n' must be equal to 1"; + assert string.fromCharCode(0xA as number, 0xD as number) == '\n\r' : "Error! Must be '\\n\\r'"; + assert string.fromCharCode(0xA as number, 0xD as number).length == 2 + : "Error! String length of '\\n\\r' must be equal to 2"; + + assert string.fromCharCode(0x41, 0x42, 0x43, 0x44) == "ABCD" : "Error! Must be 'ABC'"; + assert string.fromCharCode(0x41, 0x42, 0x43, 0x44).length == 4 + : "Error! String length of 'ABCD' must be equal to 4"; + + assert string.fromCharCode(0x3B1, 0x41, 0x42, 0x43, 0x44) == "αABCD" : "Error! Must be 'αABCD'"; + assert string.fromCharCode(0x3B1, 0x41, 0x42, 0x43, 0x44).length == 5 + : "Error! String length of 'αABCD' must be equal to 5"; + assert string.fromCharCode(0x41, 0x3B1, 0x42, 0x43, 0x44) == "AαBCD" : "Error! Must be 'AαBCD'"; + assert string.fromCharCode(0x41, 0x3B1, 0x42, 0x43, 0x44).length == 5 + : "Error! String length of 'AαBCD' must be equal to 5"; + assert string.fromCharCode(0x41, 0x42, 0x43, 0x44, 0x3B1) == "ABCDα" : "Error! Must be 'ABCDα'"; + assert string.fromCharCode(0x41, 0x42, 0x43, 0x44, 0x3B1).length == 5 + : "Error! String length of 'ABCDα' must be equal to 5"; + assert string.fromCharCode(0x3B1, 0x3B2, 0x3B3) == "αβγ" : "Error! Must be 'αβγ'"; + assert string.fromCharCode(0x3B1, 0x3B2, 0x3B3).length == 3 : "Error! String length of 'αβγ' must be equal to 3"; + + assert string.fromCharCode(65535) == "\u{ffff}" : "Error! CharCode[0] of a string built from 65535 must be 65535"; + assert string.fromCharCode(65535).length == 1; + assert string.fromCharCode(65536) == "\u{0}" : "Error! CharCode[0] of a string built from 65536 must be 0"; + assert string.fromCharCode(65536).length == 1; + assert string.fromCharCode(-65535) == "\u{1}" : "Error! CharCode[0] of a string built from -65535 must be 1"; + assert string.fromCharCode(-65535).length == 1; + assert string.fromCharCode(-65536) == "\u{0}" : "Error! CharCode[0] of a string built from -65535 must be 0"; + assert string.fromCharCode(-65536).length == 1; + assert string.fromCharCode(-1) == "\u{ffff}" : "Error! CharCode[0] of a string built from -1 must be 65535"; + assert string.fromCharCode(-1).length == 1; + assert string.fromCharCode(NaN) == "\u{0}" : "Error! CharCode[0] of a string built from NaN must be 0"; + assert string.fromCharCode(NaN).length == 1; + assert string.fromCharCode(Infinity) == "\u{0}" : "Error! CharCode[0] of a string built from Infinity must be 0"; + assert string.fromCharCode(Infinity).length == 1; + assert string.fromCharCode(0xffff0066) == "f" : "Error! Must be 'f'"; + assert string.fromCharCode(0xffff0066).length == 1 : "Error! String length of 'f' must be equal to 1"; + assert string.fromCharCode(4294901862) == "f" : "Error! Must be 'f'"; + assert string.fromCharCode(4294901862).length == 1 : "Error! String length of 'f' must be equal to 1"; + assert string.fromCharCode(0xffff0066, -100) == "fワ" : "Error! Must be 'fワ'"; + assert string.fromCharCode(0xffff0066, -100).length == 2 : "Error! String length of 'fワ' must be equal to 2"; + assert string.fromCharCode(0xffff0066, -100, NaN, Infinity) == "fワ\u{0}\u{0}" : "Error! Must be 'fワ\u{0}\u{0}'"; + assert string.fromCharCode(0xffff0066, -100, NaN, Infinity).length == 4; + + assert string.fromCharCode(0x43 as number, 0x3B2 as number, 0xD799 as number, 0x1D798 as number, 65.992 as number) == "Cβ힙힘A" + : "Error! Must be 'Cβ힙힘A'"; + + const cpsGolden = "\u{c}\u{7545}\u{ea7e}\u{15fb7}\u{1d4f0}\u{24a29}\u{2bf62}\u{3349b}\u{3a9d4}\u{41f0d}\u{49446}\u{5097f}\u{57eb8}\u{5f3f1}\u{6692a}\u{6de63}\u{7539c}\u{7c8d5}\u{83e0e}\u{8b347}\u{92880}\u{99db9}\u{a12f2}\u{a882b}\u{afd64}\u{b729d}\u{be7d6}\u{c5d0f}\u{cd248}\u{d4781}\u{dbcba}\u{e31f3}\u{ea72c}\u{f1c65}\u{f919e}\u{1006d7}\u{107c10}\u{10f149}"; + let cpsActual = ""; + for (let i = 12; i < 0x10FFFF; i += 30009) { + if (Char.codeUnitsToEncode(i) == 1) { + cpsActual += String.fromCharCode(i as number); + } else { + cpsActual += String.fromCharCode(Char.getHighSurrogate(i) as number); + cpsActual += String.fromCharCode(Char.getLowSurrogate(i) as number); + } + } + assert cpsActual == cpsGolden : "Error! cpsActual must be equal to cpsGolden"; + + assert string.fromCharCode(0xd83c, 0xdf03) == "🌃"; + + return 0; +} \ No newline at end of file diff --git a/static_core/plugins/ets/tests/ets_test_suite/intrinsics/string_from_char_code_escape.sts b/static_core/plugins/ets/tests/ets_test_suite/intrinsics/string_from_char_code_escape.sts new file mode 100644 index 000000000..0abcbcce5 --- /dev/null +++ b/static_core/plugins/ets/tests/ets_test_suite/intrinsics/string_from_char_code_escape.sts @@ -0,0 +1,21 @@ +/* + * 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 main(): int { + const escapeSeqGolden = "A%20B%u1234%00%20C"; + let escapeSeqActual = escape(String.fromCharCode(0x41, 0x20, 0x42, 0x1234, 0, 0x20, 0x43)); + assert escapeSeqActual == escapeSeqGolden : "Error! escapeSeqActual must be equal to escapeSeqGolden"; + return 0; +} \ No newline at end of file diff --git a/static_core/plugins/ets/tests/runtime/types/ets_string_test.cpp b/static_core/plugins/ets/tests/runtime/types/ets_string_test.cpp index b8835b614..c566dd4a7 100644 --- a/static_core/plugins/ets/tests/runtime/types/ets_string_test.cpp +++ b/static_core/plugins/ets/tests/runtime/types/ets_string_test.cpp @@ -61,6 +61,21 @@ public: coroutine_->ManagedCodeEnd(); } + template + static EtsString *CreateNewStringFromCharCodes(DoubleIter first, DoubleIter last) + { + EtsDoubleArray *charCodeArray = EtsDoubleArray::Create(std::distance(first, last)); + std::for_each(first, last, [&charCodeArray, idx = 0U](double d) mutable { charCodeArray->Set(idx++, d); }); + return EtsString::CreateNewStringFromCharCode(charCodeArray); + } + + static EtsString *CreateNewStringFromCharCode(double code) + { + EtsDoubleArray *charCodeArray = EtsDoubleArray::Create(1U); + charCodeArray->Set(0U, code); + return EtsString::CreateNewStringFromCharCode(charCodeArray); + } + private: RuntimeOptions options_; EtsCoroutine *coroutine_ = nullptr; @@ -576,6 +591,67 @@ TEST_F(EtsStringTest, CreateNewStringFromBytes) ASSERT_TRUE(result->StringsAreEqual(reinterpret_cast(string1))); } +TEST_F(EtsStringTest, CreateNewCompressedStringFromCharCode) +{ + EtsString *expectedCompressedString = EtsString::CreateFromMUtf8("Helloff\n"); + std::vector charCodes {0x48, 0x65, 0x6C, 0x6C, 0x6F, 4294901862, 0xffff0066, 10.316}; + EtsString *stringFromCompressedCharCodes = CreateNewStringFromCharCodes(charCodes.begin(), charCodes.end()); + ASSERT_TRUE(stringFromCompressedCharCodes->GetCoreType()->IsMUtf8()); + ASSERT_TRUE(coretypes::String::StringsAreEqual(expectedCompressedString->GetCoreType(), + stringFromCompressedCharCodes->GetCoreType())); +} + +TEST_F(EtsStringTest, CreateNewUncompressedStringFromCharCode) +{ + std::vector data = {0x3B2, 'A', 'B', 'C', 'D', 0xac, 0xff9c, 0, 0xffff, 0, 0, 0}; + EtsString *expectedUncompressedString = EtsString::CreateFromUtf16(data.data(), static_cast(data.size())); + std::vector charCodes {0x3B2, + 0x41, + 66.3, + 67.00009, + 68.99998, + 172.9999, + -100, + static_cast(0x7fffffffffffffff), + static_cast(0xffff), + static_cast(0x10000), + static_cast(0x8000000000000000), + 0}; + EtsString *stringFromUncompressedCharCodes = CreateNewStringFromCharCodes(charCodes.begin(), charCodes.end()); + ASSERT_TRUE(stringFromUncompressedCharCodes->GetCoreType()->IsUtf16()); + ASSERT_TRUE(coretypes::String::StringsAreEqual(expectedUncompressedString->GetCoreType(), + stringFromUncompressedCharCodes->GetCoreType())); +} + +TEST_F(EtsStringTest, CreateNewEmptyStringFromCharCode) +{ + EtsString *emptyString = EtsString::CreateNewEmptyString(); + std::vector charCodes {}; + EtsString *stringFromCharCodes = CreateNewStringFromCharCodes(charCodes.begin(), charCodes.end()); + ASSERT_TRUE(stringFromCharCodes->GetCoreType()->IsMUtf8()); + ASSERT_TRUE(coretypes::String::StringsAreEqual(emptyString->GetCoreType(), stringFromCharCodes->GetCoreType())); +} + +TEST_F(EtsStringTest, CreateNewStringFromNaNCharCode) +{ + std::vector data = {0}; + EtsString *expectedUncompressedString = EtsString::CreateFromUtf16(data.data(), static_cast(data.size())); + EtsString *stringFromUncompressedCharCodes = CreateNewStringFromCharCode(std::numeric_limits::quiet_NaN()); + ASSERT_TRUE(stringFromUncompressedCharCodes->GetCoreType()->IsUtf16()); + ASSERT_TRUE(coretypes::String::StringsAreEqual(expectedUncompressedString->GetCoreType(), + stringFromUncompressedCharCodes->GetCoreType())); +} + +TEST_F(EtsStringTest, CreateNewStringFromInfinityCharCode) +{ + std::vector data = {0}; + EtsString *expectedUncompressedString = EtsString::CreateFromUtf16(data.data(), static_cast(data.size())); + EtsString *stringFromUncompressedCharCodes = CreateNewStringFromCharCode(std::numeric_limits::infinity()); + ASSERT_TRUE(stringFromUncompressedCharCodes->GetCoreType()->IsUtf16()); + ASSERT_TRUE(coretypes::String::StringsAreEqual(expectedUncompressedString->GetCoreType(), + stringFromUncompressedCharCodes->GetCoreType())); +} + TEST_F(EtsStringTest, GetDataUtf16) { std::vector data = {'a', 'b', 'c', 'd', 'e', 0xac, 0}; -- Gitee From 51f073bb2e145451deace1f3f01d45ecaf743c42 Mon Sep 17 00:00:00 2001 From: Denis Zavedeev Date: Wed, 13 Nov 2024 19:24:17 +0300 Subject: [PATCH 2/6] Enable more tests Signed-off-by: Denis Zavedeev --- .../tests/checked/escape_deoptimization.sts | 7 ++- .../ets/tests/checked/ets_double_compare.sts | 5 +++ .../plugins/ets/tests/checked/ets_equals.sts | 5 +++ .../ets/tests/checked/ets_lse_phi_test.sts | 2 +- .../ets/tests/checked/ets_nested_loops.sts | 2 +- .../plugins/ets/tests/checked/ets_nullish.sts | 15 +++++++ .../ets/tests/checked/ets_overflow.sts | 2 +- .../ets_pea_loads_upward_propagation.sts | 43 +++++++++++++++++++ .../ets/tests/checked/ets_promise_launch.sts | 2 +- .../ets/tests/checked/ets_static_lookup.pa | 10 +++++ .../tests/checked/ets_static_lookup_16bit.pa | 9 ++++ .../tests/checked/ets_static_lookup_8bit.pa | 9 ++++ .../checked/ets_string_builder_merge.sts | 5 +++ .../ets_string_builder_merge_uber_export.sts | 5 +++ .../ets_string_builder_reserve_part01-10.sts | 5 +++ .../ets_string_builder_reserve_part11-19.sts | 5 +++ .../ets_string_builder_reserve_part20-29.sts | 5 +++ .../ets_string_builder_reserve_part30-44.sts | 5 +++ .../ets_string_builder_reserve_uber.sts | 5 +++ .../ets/tests/checked/ets_string_concat.sts | 2 +- .../tests/checked/ets_string_concat_func.sts | 2 +- .../tests/checked/ets_string_concat_loop.sts | 4 +- .../ets/tests/checked/ets_string_equals.sts | 7 ++- .../tests/checked/ets_string_substring.sts | 4 ++ .../ets/tests/checked/ets_stringbuilder.sts | 2 +- .../ets/tests/checked/ets_try_catch.sts | 4 +- .../ets/tests/checked/ets_try_catch1.sts | 4 +- .../ets/tests/checked/ets_try_catch10.sts | 4 +- .../ets/tests/checked/ets_try_catch11.sts | 4 +- .../ets/tests/checked/ets_try_catch12.sts | 4 +- .../ets/tests/checked/ets_try_catch13.sts | 4 +- .../ets/tests/checked/ets_try_catch14.sts | 4 +- .../ets/tests/checked/ets_try_catch15.sts | 4 +- .../ets/tests/checked/ets_try_catch2.sts | 4 +- .../ets/tests/checked/ets_try_catch3.sts | 4 +- .../ets/tests/checked/ets_try_catch4.sts | 5 +++ .../ets/tests/checked/ets_try_catch5.sts | 4 +- .../ets/tests/checked/ets_try_catch6.sts | 4 +- .../ets/tests/checked/ets_try_catch7.sts | 4 +- .../ets/tests/checked/ets_try_catch8.sts | 4 +- .../ets/tests/checked/ets_try_catch9.sts | 4 +- .../ets/tests/checked/fast_divisor.sts | 5 +++ .../inlining_test/inlining_order_1.sts | 5 +++ .../inlining_test/inlining_order_2.sts | 5 +++ .../inlining_test/inlining_order_3.sts | 5 +++ .../ets/tests/checked/string_split_test.sts | 2 +- 46 files changed, 212 insertions(+), 42 deletions(-) diff --git a/static_core/plugins/ets/tests/checked/escape_deoptimization.sts b/static_core/plugins/ets/tests/checked/escape_deoptimization.sts index 4f5bfe270..414b2cf54 100644 --- a/static_core/plugins/ets/tests/checked/escape_deoptimization.sts +++ b/static_core/plugins/ets/tests/checked/escape_deoptimization.sts @@ -56,6 +56,11 @@ function foo(obj: A, cnt: int): int { //! INST_COUNT "NewArray", 2 //! RUN options: "", entry: "ETSGLOBAL::main" +//! CHECKER LLVM AOT run for escape analysis test +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*main.*'" +//! RUN entry: "ETSGLOBAL::main" + function main() { let cnt: int = 0 let a: int[] = [ 42 ] @@ -64,7 +69,7 @@ function main() { obj.a = 1; a = [foo(obj, cnt++), foo(obj, cnt++), foo(obj, cnt++), foo(obj, cnt++), foo(obj, cnt++)]; } catch (e) { - assert e instanceof ArrayIndexOutOfBoundsError :"Throwed not ArrayIndexOutOfBoundsError" + assert e instanceof ArrayIndexOutOfBoundsError : "Threw not ArrayIndexOutOfBoundsError" assert a.length == 1 && a[0] == 42 return } diff --git a/static_core/plugins/ets/tests/checked/ets_double_compare.sts b/static_core/plugins/ets/tests/checked/ets_double_compare.sts index a66dd6933..09fafb091 100644 --- a/static_core/plugins/ets/tests/checked/ets_double_compare.sts +++ b/static_core/plugins/ets/tests/checked/ets_double_compare.sts @@ -141,6 +141,11 @@ //! INST_NOT "Fcmp" //! RUN entry: "ETSGLOBAL::main" +//! CHECKER Compare double LLVM AOT +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*main.*'" +//! RUN entry: "ETSGLOBAL::main" + function Compare_more__noinline__(str1 : String, str2 : String): boolean { return str1.length < str2.length } diff --git a/static_core/plugins/ets/tests/checked/ets_equals.sts b/static_core/plugins/ets/tests/checked/ets_equals.sts index 058a0cd6d..8d38fcbc3 100644 --- a/static_core/plugins/ets/tests/checked/ets_equals.sts +++ b/static_core/plugins/ets/tests/checked/ets_equals.sts @@ -74,6 +74,11 @@ function getobj(): SomeRef { return new Object(); } //! //! RUN entry: "ETSGLOBAL::main" +//! CHECKER LLVM AOT ets.equals +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*main.*'" +//! RUN entry: "ETSGLOBAL::main" + function equals_dce(x: SomeRef, y: SomeRef) { return getfalse() && x == y; } diff --git a/static_core/plugins/ets/tests/checked/ets_lse_phi_test.sts b/static_core/plugins/ets/tests/checked/ets_lse_phi_test.sts index 2d1db292f..1bcaa5f3e 100644 --- a/static_core/plugins/ets/tests/checked/ets_lse_phi_test.sts +++ b/static_core/plugins/ets/tests/checked/ets_lse_phi_test.sts @@ -21,7 +21,7 @@ //! CHECKER Check LSE with PHI in AOT //! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "" +//! RUN_AOT options: "" //! METHOD "ETSGLOBAL::main" //! PASS_AFTER "IrBuilder" //! INST_COUNT /StoreObject .* C0.x0/, 2 diff --git a/static_core/plugins/ets/tests/checked/ets_nested_loops.sts b/static_core/plugins/ets/tests/checked/ets_nested_loops.sts index ad03f5e48..24389ee5a 100644 --- a/static_core/plugins/ets/tests/checked/ets_nested_loops.sts +++ b/static_core/plugins/ets/tests/checked/ets_nested_loops.sts @@ -18,7 +18,7 @@ //! CHECKER AOT IR Builder nested loops //! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "--compiler-regex='.*main.*'" +//! RUN_AOT options: "--compiler-regex='.*main.*'" //! RUN entry: "ETSGLOBAL::main" class C0 { diff --git a/static_core/plugins/ets/tests/checked/ets_nullish.sts b/static_core/plugins/ets/tests/checked/ets_nullish.sts index 309466bcf..f43169133 100644 --- a/static_core/plugins/ets/tests/checked/ets_nullish.sts +++ b/static_core/plugins/ets/tests/checked/ets_nullish.sts @@ -48,6 +48,21 @@ //! PASS_AFTER "IrBuilder" //! INST_COUNT /LoadUndefined/, 1 +//! CHECKER LLVM AOT undefined +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*test_undefined.*'" +//! RUN entry: "ETSGLOBAL::test_undefined" + +//! CHECKER LLVM AOT undefined dce +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*test_undefined_dce.*'" +//! RUN entry: "ETSGLOBAL::test_undefined_dce" + +//! CHECKER LLVM AOT undefined cse +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*test_undefined_cse.*'" +//! RUN entry: "ETSGLOBAL::test_undefined_cse" + let glob: Object | null | undefined = null; function test_undefined(): int { diff --git a/static_core/plugins/ets/tests/checked/ets_overflow.sts b/static_core/plugins/ets/tests/checked/ets_overflow.sts index 902820a01..229bcf090 100644 --- a/static_core/plugins/ets/tests/checked/ets_overflow.sts +++ b/static_core/plugins/ets/tests/checked/ets_overflow.sts @@ -22,7 +22,7 @@ //! CHECKER Check AOT for ZeroCheck after ChecksElimination //! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "--compiler-regex=ETSGLOBAL::__noinline__overflow" +//! RUN_AOT options: "--compiler-regex=ETSGLOBAL::__noinline__overflow" //! METHOD "ETSGLOBAL::__noinline__overflow" //! PASS_AFTER "ChecksElimination" //! INST "ZeroCheck" diff --git a/static_core/plugins/ets/tests/checked/ets_pea_loads_upward_propagation.sts b/static_core/plugins/ets/tests/checked/ets_pea_loads_upward_propagation.sts index ab161e7b1..8f8e446b8 100644 --- a/static_core/plugins/ets/tests/checked/ets_pea_loads_upward_propagation.sts +++ b/static_core/plugins/ets/tests/checked/ets_pea_loads_upward_propagation.sts @@ -254,7 +254,50 @@ //! INST_COUNT /LoadObject.*res/, 1 //! RUN entry: "ETSGLOBAL::ntest4" +//! CHECKER LLVM AOT test1 run +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*test1.*'" +//! RUN entry: "ETSGLOBAL::test1" +//! CHECKER LLVM AOT test2 run +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*test2.*'" +//! RUN entry: "ETSGLOBAL::test2" + +//! CHECKER LLVM AOT test3 run +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*test3.*'" +//! RUN entry: "ETSGLOBAL::test3" + +//! CHECKER LLVM AOT test4 run +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*test4.*'" +//! RUN entry: "ETSGLOBAL::test4" + +//! CHECKER LLVM AOT test5 run +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*test5.*'" +//! RUN entry: "ETSGLOBAL::test5" + +//! CHECKER LLVM AOT ntest1 run +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*ntest1.*'" +//! RUN entry: "ETSGLOBAL::ntest1" + +//! CHECKER LLVM AOT ntest2 run +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*ntest2.*'" +//! RUN entry: "ETSGLOBAL::ntest2" + +//! CHECKER LLVM AOT ntest3 run +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*ntest3.*'" +//! RUN entry: "ETSGLOBAL::ntest3" + +//! CHECKER LLVM AOT ntest4 run +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*ntest4.*'" +//! RUN entry: "ETSGLOBAL::ntest4" class BBB { public res: number; diff --git a/static_core/plugins/ets/tests/checked/ets_promise_launch.sts b/static_core/plugins/ets/tests/checked/ets_promise_launch.sts index 34deccebc..52c8c9a93 100644 --- a/static_core/plugins/ets/tests/checked/ets_promise_launch.sts +++ b/static_core/plugins/ets/tests/checked/ets_promise_launch.sts @@ -20,7 +20,7 @@ //! CHECKER AOT Check for method->isStatic assert //! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "--compiler-regex='.*main.*'" +//! RUN_AOT options: "--compiler-regex='.*main.*'" function main(): int { for (let i = 0; i < 100; i++) { diff --git a/static_core/plugins/ets/tests/checked/ets_static_lookup.pa b/static_core/plugins/ets/tests/checked/ets_static_lookup.pa index d2e0646fd..8994e2514 100644 --- a/static_core/plugins/ets/tests/checked/ets_static_lookup.pa +++ b/static_core/plugins/ets/tests/checked/ets_static_lookup.pa @@ -41,6 +41,11 @@ #! INST_COUNT /StoreObject/, 2 #! RUN entry: "_GLOBAL::main" +#! CHECKER Static lookup for Fields LLVM AOT +#! SKIP_IF @architecture == "arm32" +#! RUN_LLVM options: "--compiler-regex='.*main.*'" +#! RUN entry: "_GLOBAL::main" + #! CHECKER Static lookup for Calls JIT #! RUN force_jit: true, options: "--compiler-regex='.*main.*'", entry: "_GLOBAL::main1" #! METHOD "_GLOBAL::main" @@ -69,6 +74,11 @@ #! INST /CallVirtual.Inlined/ #! RUN entry: "_GLOBAL::main1" +#! CHECKER Static lookup for Calls LLVM AOT +#! SKIP_IF @architecture == "arm32" +#! RUN_LLVM options: "--compiler-regex='.*main1.*'" +#! RUN entry: "_GLOBAL::main1" + .language eTS .record std.core.Object diff --git a/static_core/plugins/ets/tests/checked/ets_static_lookup_16bit.pa b/static_core/plugins/ets/tests/checked/ets_static_lookup_16bit.pa index e6ee98310..7a3999f40 100644 --- a/static_core/plugins/ets/tests/checked/ets_static_lookup_16bit.pa +++ b/static_core/plugins/ets/tests/checked/ets_static_lookup_16bit.pa @@ -33,6 +33,11 @@ #! INST_COUNT /i16 *StoreObject/, 2 #! RUN entry: "_GLOBAL::test_store" +#! CHECKER Static lookup for 16-bit StObjByName LLVM AOT +#! SKIP_IF @architecture == "arm32" +#! RUN_LLVM options: "--compiler-regex='.*test_store.*'" +#! RUN entry: "_GLOBAL::test_store" + #! CHECKER Static lookup for 16-bit LdObjByName JIT #! RUN force_jit: true, options: "--compiler-regex='.*test_load.*'", entry: "_GLOBAL::test_load" #! METHOD "_GLOBAL::test_load" @@ -55,6 +60,10 @@ #! INST_COUNT /i16 *LoadObject/, 3 #! RUN entry: "_GLOBAL::test_load" +#! CHECKER Static lookup for 16-bit LdObjByName LLVM AOT +#! SKIP_IF @architecture == "arm32" +#! RUN_LLVM options: "--compiler-regex='.*test_load.*'" +#! RUN entry: "_GLOBAL::test_load" .language eTS diff --git a/static_core/plugins/ets/tests/checked/ets_static_lookup_8bit.pa b/static_core/plugins/ets/tests/checked/ets_static_lookup_8bit.pa index ef93a52bf..0cacc7460 100644 --- a/static_core/plugins/ets/tests/checked/ets_static_lookup_8bit.pa +++ b/static_core/plugins/ets/tests/checked/ets_static_lookup_8bit.pa @@ -33,6 +33,11 @@ #! INST_COUNT /i8 *StoreObject/, 2 #! RUN entry: "_GLOBAL::test_store" +#! CHECKER Static lookup for 8-bit StObjByName LLVM AOT +#! SKIP_IF @architecture == "arm32" +#! RUN_LLVM options: "--compiler-regex='.*test_store.*'" +#! RUN entry: "_GLOBAL::test_store" + #! CHECKER Static lookup for 8-bit LdObjByName JIT #! RUN force_jit: true, options: "--compiler-regex='.*test_load.*'", entry: "_GLOBAL::test_load" #! METHOD "_GLOBAL::test_load" @@ -55,6 +60,10 @@ #! INST_COUNT /i8 *LoadObject/, 3 #! RUN entry: "_GLOBAL::test_load" +#! CHECKER Static lookup for 8-bit LdObjByName LLVM AOT +#! SKIP_IF @architecture == "arm32" +#! RUN_LLVM options: "--compiler-regex='.*test_load.*'" +#! RUN entry: "_GLOBAL::test_load" .language eTS diff --git a/static_core/plugins/ets/tests/checked/ets_string_builder_merge.sts b/static_core/plugins/ets/tests/checked/ets_string_builder_merge.sts index 419d9dbc4..34c151c94 100644 --- a/static_core/plugins/ets/tests/checked/ets_string_builder_merge.sts +++ b/static_core/plugins/ets/tests/checked/ets_string_builder_merge.sts @@ -392,6 +392,11 @@ //! INST_COUNT "Intrinsic.StdCoreSbToString",2 //! INST_NOT "String::concat" +//! CHECKER LLVM AOT +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*main.*'" +//! RUN entry: "ETSGLOBAL::main" + // Each '+=' operation on strings in tests below is translated into StringBuilder + 2 append calls by frontend function chain_concat0(a: String, n: int, b: String, m: int): String { diff --git a/static_core/plugins/ets/tests/checked/ets_string_builder_merge_uber_export.sts b/static_core/plugins/ets/tests/checked/ets_string_builder_merge_uber_export.sts index 024a03327..19f5a4986 100644 --- a/static_core/plugins/ets/tests/checked/ets_string_builder_merge_uber_export.sts +++ b/static_core/plugins/ets/tests/checked/ets_string_builder_merge_uber_export.sts @@ -45,6 +45,11 @@ //! PASS_AFTER "Codegen" //! INST_COUNT "Intrinsic.StdCoreSbToString",5 +//! CHECKER LLVM AOT run for String Builders merging test +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*main.*'" +//! RUN entry: "ETSGLOBAL::main" + export function uber_chain_concat4(do_exit: boolean, a: String, n: int, b: String, m: int, c: String, l: int, d: String, k: int, cond0: boolean, cond1: boolean, do_throw0: boolean, do_throw1: boolean): String { /* diff --git a/static_core/plugins/ets/tests/checked/ets_string_builder_reserve_part01-10.sts b/static_core/plugins/ets/tests/checked/ets_string_builder_reserve_part01-10.sts index 76dbd4947..79d883ad8 100644 --- a/static_core/plugins/ets/tests/checked/ets_string_builder_reserve_part01-10.sts +++ b/static_core/plugins/ets/tests/checked/ets_string_builder_reserve_part01-10.sts @@ -142,6 +142,11 @@ //! PASS_AFTER "ReserveStringBuilderBuffer" //! INST "NewArray (size=9)" +//! CHECKER LLVM AOT run for StringBuilder internal buffer reserve test +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*main.*'" +//! RUN entry: "ETSGLOBAL::main" + function reserve1() : string { let sb = new StringBuilder() // applied sb.append(0) diff --git a/static_core/plugins/ets/tests/checked/ets_string_builder_reserve_part11-19.sts b/static_core/plugins/ets/tests/checked/ets_string_builder_reserve_part11-19.sts index 6402b8f97..baed8124e 100644 --- a/static_core/plugins/ets/tests/checked/ets_string_builder_reserve_part11-19.sts +++ b/static_core/plugins/ets/tests/checked/ets_string_builder_reserve_part11-19.sts @@ -129,6 +129,11 @@ //! PASS_AFTER "ReserveStringBuilderBuffer" //! INST "NewArray (size=5)" +//! CHECKER LLVM AOT run for StringBuilder internal buffer reserve test +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*main.*'" +//! RUN entry: "ETSGLOBAL::main" + function uncountable_loop_reserve11() : string { let sb = new StringBuilder() // not applied, due to uncountable loop sb.append(0) diff --git a/static_core/plugins/ets/tests/checked/ets_string_builder_reserve_part20-29.sts b/static_core/plugins/ets/tests/checked/ets_string_builder_reserve_part20-29.sts index 31b35f74b..9940433e1 100644 --- a/static_core/plugins/ets/tests/checked/ets_string_builder_reserve_part20-29.sts +++ b/static_core/plugins/ets/tests/checked/ets_string_builder_reserve_part20-29.sts @@ -145,6 +145,11 @@ //! INST "NewArray (size=6)" //! INST_NOT "NewArray (size=9)" +//! CHECKER LLVM AOT run for StringBuilder internal buffer reserve test +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*main.*'" +//! RUN entry: "ETSGLOBAL::main" + function multi_toString_reserve20() : string { let sb = new StringBuilder() // applied sb.append(0) diff --git a/static_core/plugins/ets/tests/checked/ets_string_builder_reserve_part30-44.sts b/static_core/plugins/ets/tests/checked/ets_string_builder_reserve_part30-44.sts index 98c51d73b..24b5506dc 100644 --- a/static_core/plugins/ets/tests/checked/ets_string_builder_reserve_part30-44.sts +++ b/static_core/plugins/ets/tests/checked/ets_string_builder_reserve_part30-44.sts @@ -203,6 +203,11 @@ //! RUN force_jit: true, options: "--compiler-reserve-string-builder-buffer=true --compiler-inlining=true", entry: "ETSGLOBAL::main_events_check" //! EVENT_NOT "SbBufferRealloc" +//! CHECKER LLVM AOT run StringBuilder internal buffer reserve test +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*main.*'" +//! RUN entry: "ETSGLOBAL::main" + function try_catch_reserve30(do_throw: boolean) : string { let sb = new StringBuilder() // applied try { diff --git a/static_core/plugins/ets/tests/checked/ets_string_builder_reserve_uber.sts b/static_core/plugins/ets/tests/checked/ets_string_builder_reserve_uber.sts index a04473398..259bd9a18 100644 --- a/static_core/plugins/ets/tests/checked/ets_string_builder_reserve_uber.sts +++ b/static_core/plugins/ets/tests/checked/ets_string_builder_reserve_uber.sts @@ -52,6 +52,11 @@ //! SKIP_IF @architecture == "arm32" //! RUN force_jit: true, options: "--gc-type=g1-gc --no-async-jit=false --compiler-reserve-string-builder-buffer=true --compiler-inlining=true", entry: "ETSGLOBAL::main" +//! CHECKER LLVM AOT run for StringBuilder internal buffer reserve test +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*main.*'" +//! RUN entry: "ETSGLOBAL::main" + function uber_reserve38(cond: boolean) : string { let nullString: String = new String(null); diff --git a/static_core/plugins/ets/tests/checked/ets_string_concat.sts b/static_core/plugins/ets/tests/checked/ets_string_concat.sts index 72bcb5666..31777d27d 100644 --- a/static_core/plugins/ets/tests/checked/ets_string_concat.sts +++ b/static_core/plugins/ets/tests/checked/ets_string_concat.sts @@ -16,7 +16,7 @@ //! CHECKER AOT IR Builder, check String concatenation //! SKIP_IF @architecture == "arm32" //! RUN entry: "ETSGLOBAL::main" -//! RUN_PAOC options: "--compiler-regex='.*concat[0-9]+' --compiler-inlining=false" +//! RUN_AOT options: "--compiler-regex='.*concat[0-9]+' --compiler-inlining=false" //! //! METHOD "ETSGLOBAL::concat0" //! PASS_BEFORE "BranchElimination" diff --git a/static_core/plugins/ets/tests/checked/ets_string_concat_func.sts b/static_core/plugins/ets/tests/checked/ets_string_concat_func.sts index 6d94bc9fa..5123989f3 100644 --- a/static_core/plugins/ets/tests/checked/ets_string_concat_func.sts +++ b/static_core/plugins/ets/tests/checked/ets_string_concat_func.sts @@ -15,7 +15,7 @@ //! CHECKER AOT IR Builder, check String.concat function //! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "--compiler-regex='.*concat[0-9]+'" +//! RUN_AOT options: "--compiler-regex='.*concat[0-9]+'" //! //! RUN entry: "ETSGLOBAL::main" diff --git a/static_core/plugins/ets/tests/checked/ets_string_concat_loop.sts b/static_core/plugins/ets/tests/checked/ets_string_concat_loop.sts index 764feee0f..9a32e5442 100644 --- a/static_core/plugins/ets/tests/checked/ets_string_concat_loop.sts +++ b/static_core/plugins/ets/tests/checked/ets_string_concat_loop.sts @@ -1578,7 +1578,7 @@ function main() { //! CHECKER Invalid save states AOT (I9NI8P/16707) //! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "--compiler-regex='.*bugfix_concat_loop2_test[0-9]+' --compiler-inlining=true" +//! RUN_AOT options: "--compiler-regex='.*bugfix_concat_loop2_test[0-9]+' --compiler-inlining=true" //! CHECKER Invalid save states JIT (I9NI8P/16707) //! SKIP_IF @architecture == "arm32" @@ -1669,7 +1669,7 @@ function bugfix_concat_loop2() { //! CHECKER Invalid phi instruction AOT (IARN2S/19226) //! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "--compiler-regex='.*bugfix_concat_loop3' --compiler-loop-unroll=false --compiler-inlining=true" +//! RUN_AOT options: "--compiler-regex='.*bugfix_concat_loop3' --compiler-loop-unroll=false --compiler-inlining=true" //! CHECKER Invalid phi instruction JIT (IARN2S/19226) //! SKIP_IF @architecture == "arm32" diff --git a/static_core/plugins/ets/tests/checked/ets_string_equals.sts b/static_core/plugins/ets/tests/checked/ets_string_equals.sts index b2fe966c4..08f590253 100644 --- a/static_core/plugins/ets/tests/checked/ets_string_equals.sts +++ b/static_core/plugins/ets/tests/checked/ets_string_equals.sts @@ -43,7 +43,12 @@ //! //! RUN entry: "ETSGLOBAL::main" -// Prevents comparison elimination by frontend type inferrence +//! CHECKER String equal LLVM AOT +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*main.*'" +//! RUN entry: "ETSGLOBAL::main" + +// Prevents comparison elimination by frontend type inference function getnull(): String | null { return null; } diff --git a/static_core/plugins/ets/tests/checked/ets_string_substring.sts b/static_core/plugins/ets/tests/checked/ets_string_substring.sts index b5adc85c1..3bc799403 100644 --- a/static_core/plugins/ets/tests/checked/ets_string_substring.sts +++ b/static_core/plugins/ets/tests/checked/ets_string_substring.sts @@ -37,6 +37,10 @@ let original: String = new String("abcde"); //! CHECKER Equal Substring INT //! RUN options: "--compiler-enable-jit=false", entry: "ETSGLOBAL::main" +//! CHECKER Equal Substring LLVM AOT +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*main.*'" +//! RUN entry: "ETSGLOBAL::main" function __noinline__SubString(str: String, begin: int, end: int): String { return str.substring(begin, end); diff --git a/static_core/plugins/ets/tests/checked/ets_stringbuilder.sts b/static_core/plugins/ets/tests/checked/ets_stringbuilder.sts index d301fa1e7..d9f3589d9 100644 --- a/static_core/plugins/ets/tests/checked/ets_stringbuilder.sts +++ b/static_core/plugins/ets/tests/checked/ets_stringbuilder.sts @@ -15,7 +15,7 @@ //! CHECKER AOT IR Builder, check StringBuilder::toString replacement //! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "--compiler-regex='.*toString[0-9]+.*' --compiler-inlining=false" +//! RUN_AOT options: "--compiler-regex='.*toString[0-9]+.*' --compiler-inlining=false" //! //! METHOD "ETSGLOBAL::toString0" //! PASS_BEFORE "BranchElimination" diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch.sts b/static_core/plugins/ets/tests/checked/ets_try_catch.sts index 8bbed0705..73fd84237 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch.sts @@ -23,8 +23,8 @@ //! INST_NOT "Throw" //! CHECKER Try Catch Resolving AOT Optimize when default catch is outside -//! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" +//! SKIP_IF @architecture == "arm32" +//! RUN_AOT options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" //! METHOD "MultipleCatch::__noinline__multipleCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch1.sts b/static_core/plugins/ets/tests/checked/ets_try_catch1.sts index 76d233b43..0bb497142 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch1.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch1.sts @@ -23,8 +23,8 @@ //! INST_NOT "Throw" //! CHECKER Try Catch Resolving AOT Optimize with default catch only -//! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" +//! SKIP_IF @architecture == "arm32" +//! RUN_AOT options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" //! METHOD "MultipleCatch::__noinline__multipleCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch10.sts b/static_core/plugins/ets/tests/checked/ets_try_catch10.sts index 7d138b97a..d90c7a344 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch10.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch10.sts @@ -24,8 +24,8 @@ //! INST_NOT "DeoptimizeIf" //! CHECKER Try Catch Resolving AOT IfImm is not replaced by DeoptimizeIf -//! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "--compiler-regex=IfCatch::__noinline__ifCatch" +//! SKIP_IF @architecture == "arm32" +//! RUN_AOT options: "--compiler-regex=IfCatch::__noinline__ifCatch" //! METHOD "IfCatch::__noinline__ifCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch11.sts b/static_core/plugins/ets/tests/checked/ets_try_catch11.sts index 91edc24c8..da43a2d7e 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch11.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch11.sts @@ -24,8 +24,8 @@ //! INST "DeoptimizeIf" //! CHECKER Try Catch Resolving AOT IfImm is not replaced by DeoptimizeIf -//! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "--compiler-regex=IfCatch::__noinline__ifCatch" +//! SKIP_IF @architecture == "arm32" +//! RUN_AOT options: "--compiler-regex=IfCatch::__noinline__ifCatch" //! METHOD "IfCatch::__noinline__ifCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch12.sts b/static_core/plugins/ets/tests/checked/ets_try_catch12.sts index ea7c73603..e48504ccb 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch12.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch12.sts @@ -24,8 +24,8 @@ //! INST "DeoptimizeIf" //! CHECKER Try Catch Resolving AOT IfImm is not replaced by DeoptimizeIf -//! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "--compiler-regex=IfCatch::__noinline__ifCatch" +//! SKIP_IF @architecture == "arm32" +//! RUN_AOT options: "--compiler-regex=IfCatch::__noinline__ifCatch" //! METHOD "IfCatch::__noinline__ifCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch13.sts b/static_core/plugins/ets/tests/checked/ets_try_catch13.sts index 4cfb6b893..92159cb03 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch13.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch13.sts @@ -24,8 +24,8 @@ //! INST "DeoptimizeIf" //! CHECKER Try Catch Resolving AOT IfImm is not replaced by DeoptimizeIf -//! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "--compiler-regex=IfCatch::__noinline__ifCatch" +//! SKIP_IF @architecture == "arm32" +//! RUN_AOT options: "--compiler-regex=IfCatch::__noinline__ifCatch" //! METHOD "IfCatch::__noinline__ifCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch14.sts b/static_core/plugins/ets/tests/checked/ets_try_catch14.sts index 08187e02a..5bdf7a3ee 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch14.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch14.sts @@ -24,8 +24,8 @@ //! INST "DeoptimizeIf" //! CHECKER Try Catch Resolving AOT IfImm is not replaced by DeoptimizeIf -//! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "--compiler-regex=IfCatch::__noinline__ifCatch" +//! SKIP_IF @architecture == "arm32" +//! RUN_AOT options: "--compiler-regex=IfCatch::__noinline__ifCatch" //! METHOD "IfCatch::__noinline__ifCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch15.sts b/static_core/plugins/ets/tests/checked/ets_try_catch15.sts index 4ba3aa4c2..a04e98bcd 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch15.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch15.sts @@ -24,8 +24,8 @@ //! INST "DeoptimizeIf" //! CHECKER Try Catch Resolving AOT IfImm is not replaced by DeoptimizeIf -//! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "--compiler-regex=ETSGLOBAL::__noinline__test" +//! SKIP_IF @architecture == "arm32" +//! RUN_AOT options: "--compiler-regex=ETSGLOBAL::__noinline__test" //! METHOD "ETSGLOBAL::__noinline__test" //! PASS_AFTER "Inline" //! INST "Throw" diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch2.sts b/static_core/plugins/ets/tests/checked/ets_try_catch2.sts index 7e085b3ad..66699b267 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch2.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch2.sts @@ -23,8 +23,8 @@ //! INST_NOT "Throw" //! CHECKER Try Catch Resolving AOT Optimize with partial and default catches -//! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" +//! SKIP_IF @architecture == "arm32" +//! RUN_AOT options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" //! METHOD "MultipleCatch::__noinline__multipleCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch3.sts b/static_core/plugins/ets/tests/checked/ets_try_catch3.sts index f5320ba62..1b05aaa12 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch3.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch3.sts @@ -23,8 +23,8 @@ //! INST_NOT "Throw" //! CHECKER Try Catch Resolving AOT Optimize with default catch on the same level -//! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" +//! SKIP_IF @architecture == "arm32" +//! RUN_AOT options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" //! METHOD "MultipleCatch::__noinline__multipleCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",3 diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch4.sts b/static_core/plugins/ets/tests/checked/ets_try_catch4.sts index a5290e27a..b5ef37ab2 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch4.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch4.sts @@ -32,6 +32,11 @@ //! PASS_AFTER "TryCatchResolving" //! INST_COUNT "Throw",2 +//! CHECKER LLVM AOT run for exceptions test +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*main.*'" +//! RUN entry: "ETSGLOBAL::main" + class Exception0 extends Exception {} class Exception1 extends Exception {} diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch5.sts b/static_core/plugins/ets/tests/checked/ets_try_catch5.sts index e2fb4f2d5..dbc55a986 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch5.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch5.sts @@ -23,8 +23,8 @@ //! INST_COUNT "Throw",2 //! CHECKER Try Catch Resolving AOT with with exception instances as function parameters -//! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" +//! SKIP_IF @architecture == "arm32" +//! RUN_AOT options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" //! METHOD "MultipleCatch::__noinline__multipleCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch6.sts b/static_core/plugins/ets/tests/checked/ets_try_catch6.sts index 1f53a3534..dc65675d7 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch6.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch6.sts @@ -23,8 +23,8 @@ //! INST_NOT "Throw" //! CHECKER Try Catch Resolving AOT with with exception instances as function parameters -//! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" +//! SKIP_IF @architecture == "arm32" +//! RUN_AOT options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" //! METHOD "MultipleCatch::__noinline__multipleCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",3 diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch7.sts b/static_core/plugins/ets/tests/checked/ets_try_catch7.sts index 20829bdeb..5a0819e61 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch7.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch7.sts @@ -23,8 +23,8 @@ //! INST_NOT "Throw" //! CHECKER Try Catch Resolving AOT with with exception instances as function parameters -//! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" +//! SKIP_IF @architecture == "arm32" +//! RUN_AOT options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" //! METHOD "MultipleCatch::__noinline__multipleCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch8.sts b/static_core/plugins/ets/tests/checked/ets_try_catch8.sts index 3ae80b4ac..210bf270b 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch8.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch8.sts @@ -26,8 +26,8 @@ //! INST_NOT "Throw" //! CHECKER Try Catch Resolving AOT with with exception instances as function parameters -//! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "--compiler-regex=MultipleCatch::multipleCatch" +//! SKIP_IF @architecture == "arm32" +//! RUN_AOT options: "--compiler-regex=MultipleCatch::multipleCatch" //! METHOD "MultipleCatch::multipleCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch9.sts b/static_core/plugins/ets/tests/checked/ets_try_catch9.sts index b665a3bd9..6aedea5bc 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch9.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch9.sts @@ -24,8 +24,8 @@ //! INST "DeoptimizeIf" //! CHECKER Try Catch Resolving AOT IfImm is not replaced by DeoptimizeIf -//! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "--compiler-regex=IfCatch::__noinline__ifCatch" +//! SKIP_IF @architecture == "arm32" +//! RUN_AOT options: "--compiler-regex=IfCatch::__noinline__ifCatch" //! METHOD "IfCatch::__noinline__ifCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 diff --git a/static_core/plugins/ets/tests/checked/fast_divisor.sts b/static_core/plugins/ets/tests/checked/fast_divisor.sts index e684b3007..11e9f5ca9 100644 --- a/static_core/plugins/ets/tests/checked/fast_divisor.sts +++ b/static_core/plugins/ets/tests/checked/fast_divisor.sts @@ -308,6 +308,11 @@ //! ASM_NOT x64: "idiv", arm64: "sdiv" //! RUN entry: "ETSGLOBAL::main" +//! CHECKER LLVM AOT +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*main.*'" +//! RUN entry: "ETSGLOBAL::main" + // Int Div/Mod by 7 function IntDivBy7(num: int): int { return num / 7; diff --git a/static_core/plugins/ets/tests/checked/inlining_test/inlining_order_1.sts b/static_core/plugins/ets/tests/checked/inlining_test/inlining_order_1.sts index e9f388419..513159dad 100644 --- a/static_core/plugins/ets/tests/checked/inlining_test/inlining_order_1.sts +++ b/static_core/plugins/ets/tests/checked/inlining_test/inlining_order_1.sts @@ -29,6 +29,11 @@ //! EVENT_NEXT /Inline,ETSGLOBAL::test_loops,ETSGLOBAL::cold,.*,STATIC,SUCCESS/ //! RUN options: "--log-level=debug --log-components=compiler --compiler-log=inlining", entry: "ETSGLOBAL::main" +//! CHECKER LLVM AOT inline run +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*main.*'" +//! RUN entry: "ETSGLOBAL::main" + function cold(): int { return 30; } function hot(i:int):int { return -i; } diff --git a/static_core/plugins/ets/tests/checked/inlining_test/inlining_order_2.sts b/static_core/plugins/ets/tests/checked/inlining_test/inlining_order_2.sts index b6e12bcac..7b55f934a 100644 --- a/static_core/plugins/ets/tests/checked/inlining_test/inlining_order_2.sts +++ b/static_core/plugins/ets/tests/checked/inlining_test/inlining_order_2.sts @@ -40,6 +40,11 @@ //! EVENT_NEXT /Inline,ETSGLOBAL::test_loops,ETSGLOBAL::cold,.*,STATIC,SUCCESS/ //!# EVENT_NEXT /Inline,ETSGLOBAL::test_loops,ETSGLOBAL::hot_catch,.*,STATIC,SUCCESS/ (Inlining in catch blocks is not supported) +//! CHECKER LLVM AOT inline run +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*main.*'" +//! RUN entry: "ETSGLOBAL::main" + function cold(): int { return 30; } function if_4th(i:int):int { return -i; } function if_not_4th(i:int):int { return -i; } diff --git a/static_core/plugins/ets/tests/checked/inlining_test/inlining_order_3.sts b/static_core/plugins/ets/tests/checked/inlining_test/inlining_order_3.sts index d8bd106f6..ce205e270 100644 --- a/static_core/plugins/ets/tests/checked/inlining_test/inlining_order_3.sts +++ b/static_core/plugins/ets/tests/checked/inlining_test/inlining_order_3.sts @@ -36,6 +36,11 @@ //! EVENT_NEXT /Inline,ETSGLOBAL::test_loops,ETSGLOBAL::cold,.*,STATIC,SUCCESS/ //! RUN options: "--log-level=debug --log-components=compiler --compiler-log=inlining", entry: "ETSGLOBAL::main" +//! CHECKER LLVM AOT inline run +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*main.*'" +//! RUN entry: "ETSGLOBAL::main" + function cold(): int { return 30; } function hot_inf(i:int):int { return -i; } diff --git a/static_core/plugins/ets/tests/checked/string_split_test.sts b/static_core/plugins/ets/tests/checked/string_split_test.sts index b7b858c43..1eb4ff032 100644 --- a/static_core/plugins/ets/tests/checked/string_split_test.sts +++ b/static_core/plugins/ets/tests/checked/string_split_test.sts @@ -15,7 +15,7 @@ //! CHECKER AOT test check no deoptimization occurs in String.split //! SKIP_IF @architecture == "arm32" -//! RUN_PAOC options: "--compiler-inlining=true" +//! RUN_AOT options: "--compiler-inlining=true" //! EVENT_NOT /Deoptimization,ETSGLOBAL::main,BOUNDS_CHECK/ //! METHOD "ETSGLOBAL::main" -- Gitee From 7480c2d37b5301a403c17e82279ff32b123e9714 Mon Sep 17 00:00:00 2001 From: Denis Zavedeev Date: Thu, 14 Nov 2024 19:37:39 +0300 Subject: [PATCH 3/6] Strict llvm aot checker Signed-off-by: Denis Zavedeev --- .../lowering/llvm_ir_constructor.cpp | 4 +- .../checked/checks_elimination_no_hoist.sts | 4 + .../ets_string_builder_append_merge_part1.sts | 5 ++ .../ets_string_builder_append_merge_part2.sts | 5 ++ .../ets_string_builder_append_merge_part3.sts | 5 ++ .../ets_string_builder_append_merge_part4.sts | 5 ++ .../tests/checked/ets_string_concat_loop.sts | 5 ++ .../ets/tests/checked/ets_stringbuilder.sts | 7 +- .../ets/tests/checked/ets_try_catch.sts | 6 +- .../ets/tests/checked/ets_try_catch1.sts | 6 +- .../ets/tests/checked/ets_try_catch10.sts | 6 +- .../ets/tests/checked/ets_try_catch11.sts | 6 +- .../ets/tests/checked/ets_try_catch12.sts | 6 +- .../ets/tests/checked/ets_try_catch13.sts | 6 +- .../ets/tests/checked/ets_try_catch14.sts | 6 +- .../ets/tests/checked/ets_try_catch15.sts | 6 +- .../ets/tests/checked/ets_try_catch2.sts | 6 +- .../ets/tests/checked/ets_try_catch3.sts | 6 +- .../ets/tests/checked/ets_try_catch5.sts | 6 +- .../ets/tests/checked/ets_try_catch6.sts | 6 +- .../ets/tests/checked/ets_try_catch7.sts | 6 +- .../ets/tests/checked/ets_try_catch8.sts | 6 +- .../ets/tests/checked/ets_try_catch9.sts | 6 +- .../tests/checked/js_call/js_call.sts | 4 + static_core/tests/checked/aot.pa | 23 +----- static_core/tests/checked/cast_bool.pa | 9 +- .../checked/checkcast_elimination_test.pa | 23 +----- static_core/tests/checked/checker.rb | 82 ++++++++++++++++++- static_core/tests/checked/cleanup_sso.pa | 3 + static_core/tests/checked/const_array_test.pa | 12 +-- static_core/tests/checked/cross_peephole.pa | 13 +-- .../tests/checked/deoptimize_compare.pa | 3 + .../tests/checked/disasm_and_log_demo.pa | 2 +- .../checked/external_call/external-call-01.pa | 8 +- .../tests/checked/external_inline/a.pa | 6 +- static_core/tests/checked/float_intrinsic.pa | 4 + static_core/tests/checked/force_an.pa | 4 +- .../tests/checked/force_unresolved_option.pa | 4 +- static_core/tests/checked/ifcvt.pa | 10 +++ .../tests/checked/implicit_nullcheck_tests.pa | 4 + .../checked/inline-external-constructor.pa | 4 + static_core/tests/checked/inline.pa | 12 +++ static_core/tests/checked/inline_small.pa | 4 + .../tests/checked/irreducible_loop_test.pa | 9 +- static_core/tests/checked/ldarray_obj.pa | 6 +- .../tests/checked/loop-unroll-constant.pa | 4 + static_core/tests/checked/memory-barrier.pa | 2 +- .../tests/checked/memory-coalescing.pa | 5 ++ .../tests/checked/memory-coalescing1.pa | 5 ++ .../tests/checked/memset_loop_idiom.pa | 4 + static_core/tests/checked/parameter_test.pa | 7 +- .../tests/checked/ref_check_elim_test.pa | 17 +--- .../tests/checked/remove_redundant_checks.pa | 5 ++ .../tests/checked/scalar_replacement.pa | 4 + static_core/tests/checked/stack_overflow.pa | 13 +-- static_core/tests/checked/tlab_test.pa | 21 +---- .../verify_aot_tests/verify_aot_test.pa | 4 + .../tests/checked/zero_const_in_save_state.pa | 16 +--- 58 files changed, 319 insertions(+), 167 deletions(-) diff --git a/static_core/libllvmbackend/lowering/llvm_ir_constructor.cpp b/static_core/libllvmbackend/lowering/llvm_ir_constructor.cpp index 91c35a00d..a1e322a11 100644 --- a/static_core/libllvmbackend/lowering/llvm_ir_constructor.cpp +++ b/static_core/libllvmbackend/lowering/llvm_ir_constructor.cpp @@ -4730,9 +4730,11 @@ void LLVMIrConstructor::VisitIntrinsic(GraphVisitor *v, Inst *inst) { auto ctor = static_cast(v); auto entryId = inst->CastToIntrinsic()->GetIntrinsicId(); + [[maybe_unused]] size_t explicitArgs = 0; + ASSERT(!IsStackRangeIntrinsic(entryId, &explicitArgs)); // Some Ark intrinsics are lowered into code or LLVM intrinsics, the IntrinsicsLowering pass - // makes final desicion for them to be lowered into code or calling Ark entrypoint. + // makes final decision for them to be lowered into code or calling Ark entrypoint. if (g_options.IsCompilerEncodeIntrinsics()) { bool lowered = ctor->TryEmitIntrinsic(inst, entryId); if (lowered) { diff --git a/static_core/plugins/ets/tests/checked/checks_elimination_no_hoist.sts b/static_core/plugins/ets/tests/checked/checks_elimination_no_hoist.sts index fb8f21ef5..c8f7bce4b 100644 --- a/static_core/plugins/ets/tests/checked/checks_elimination_no_hoist.sts +++ b/static_core/plugins/ets/tests/checked/checks_elimination_no_hoist.sts @@ -167,6 +167,10 @@ function NullCheck(): int { //! PASS_AFTER "IrBuilder" //! INST "LoadCompressedStringChar"; lcscId = /([0-9]+)\./.match(@ir_scope.lines[@ir_scope.current_index - 1])[1] //! EVENT /licm,inst_id:#{lcscId}/ + +//! CHECKER LLVM AOT sanity check +//! RUN_LLVM options: "" + function __noinline__getstr(): string { return "x"; } diff --git a/static_core/plugins/ets/tests/checked/ets_string_builder_append_merge_part1.sts b/static_core/plugins/ets/tests/checked/ets_string_builder_append_merge_part1.sts index 0c6c2d40b..42cd9568c 100644 --- a/static_core/plugins/ets/tests/checked/ets_string_builder_append_merge_part1.sts +++ b/static_core/plugins/ets/tests/checked/ets_string_builder_append_merge_part1.sts @@ -165,6 +165,11 @@ //! SKIP_IF @architecture == "arm32" //! RUN force_jit: true, options: "--gc-type=g1-gc --no-async-jit=false --compiler-regex='.*append[0-9]*' --compiler-inlining=true", entry: "ETSGLOBAL::main" +//! CHECKER LLVM AOT sanity check +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "" +//! RUN entry: "ETSGLOBAL::main" + function _1_toString_7_append8(): string { let sb = new StringBuilder(); diff --git a/static_core/plugins/ets/tests/checked/ets_string_builder_append_merge_part2.sts b/static_core/plugins/ets/tests/checked/ets_string_builder_append_merge_part2.sts index 46e27d9ad..12e44256e 100644 --- a/static_core/plugins/ets/tests/checked/ets_string_builder_append_merge_part2.sts +++ b/static_core/plugins/ets/tests/checked/ets_string_builder_append_merge_part2.sts @@ -103,6 +103,11 @@ //! SKIP_IF @architecture == "arm32" //! RUN force_jit: true, options: "--gc-type=g1-gc --no-async-jit=false --compiler-regex='.*append[0-9]*' --compiler-inlining=true", entry: "ETSGLOBAL::main" +//! CHECKER LLVM AOT sanity check +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "" +//! RUN entry: "ETSGLOBAL::main" + function _0_if1_else1_2_append4(cond: boolean): string { let sb = new StringBuilder(); if (sb != null) sb.toString(); diff --git a/static_core/plugins/ets/tests/checked/ets_string_builder_append_merge_part3.sts b/static_core/plugins/ets/tests/checked/ets_string_builder_append_merge_part3.sts index a8529ed02..9ab5d3d70 100644 --- a/static_core/plugins/ets/tests/checked/ets_string_builder_append_merge_part3.sts +++ b/static_core/plugins/ets/tests/checked/ets_string_builder_append_merge_part3.sts @@ -185,6 +185,11 @@ //! SKIP_IF @architecture == "arm32" //! RUN force_jit: true, options: "--gc-type=g1-gc --no-async-jit=false --compiler-regex='.*append[0-9]*' --compiler-inlining=true", entry: "ETSGLOBAL::main" +//! CHECKER LLVM AOT sanity check +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "" +//! RUN entry: "ETSGLOBAL::main" + function _0_int_3_append4(): string { let sb = new StringBuilder(); if (sb != null) sb.toString(); diff --git a/static_core/plugins/ets/tests/checked/ets_string_builder_append_merge_part4.sts b/static_core/plugins/ets/tests/checked/ets_string_builder_append_merge_part4.sts index 131d39550..cc6f2ee94 100644 --- a/static_core/plugins/ets/tests/checked/ets_string_builder_append_merge_part4.sts +++ b/static_core/plugins/ets/tests/checked/ets_string_builder_append_merge_part4.sts @@ -155,6 +155,11 @@ //! SKIP_IF @architecture == "arm32" //! RUN force_jit: true, options: "--gc-type=g1-gc --no-async-jit=false --compiler-regex='.*append[0-9]*' --compiler-inlining=true", entry: "ETSGLOBAL::main" +//! CHECKER LLVM AOT sanity check +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "" +//! RUN entry: "ETSGLOBAL::main" + function append2(str0: string, str1: string): string { let sb = new StringBuilder(); if (sb != null) sb.toString(); // to prevent replacing append calls with concat intrinsic diff --git a/static_core/plugins/ets/tests/checked/ets_string_concat_loop.sts b/static_core/plugins/ets/tests/checked/ets_string_concat_loop.sts index 9a32e5442..ff3f71fde 100644 --- a/static_core/plugins/ets/tests/checked/ets_string_concat_loop.sts +++ b/static_core/plugins/ets/tests/checked/ets_string_concat_loop.sts @@ -1068,6 +1068,11 @@ //! IN_BLOCK /loop 1/ //! INST_NOT /StringBuilder::/ +//! CHECKER LLVM AOT sanity check +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "" +//! RUN entry: "ETSGLOBAL::main" + function concat_loop0(a: String, n: int): String { let str: String = ""; for (let i = 0; i < n; ++i) diff --git a/static_core/plugins/ets/tests/checked/ets_stringbuilder.sts b/static_core/plugins/ets/tests/checked/ets_stringbuilder.sts index d9f3589d9..260dad3e1 100644 --- a/static_core/plugins/ets/tests/checked/ets_stringbuilder.sts +++ b/static_core/plugins/ets/tests/checked/ets_stringbuilder.sts @@ -15,7 +15,7 @@ //! CHECKER AOT IR Builder, check StringBuilder::toString replacement //! SKIP_IF @architecture == "arm32" -//! RUN_AOT options: "--compiler-regex='.*toString[0-9]+.*' --compiler-inlining=false" +//! RUN_PAOC options: "--compiler-regex='.*toString[0-9]+.*' --compiler-inlining=false" //! //! METHOD "ETSGLOBAL::toString0" //! PASS_BEFORE "BranchElimination" @@ -322,6 +322,11 @@ //! INST /StringBuilder::/ //! INST_COUNT /Intrinsic.StdCoreSbToString/,1 +//! CHECKER Sanity check for LLVM AOT +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex='.*toString[0-9]+.*' --compiler-inlining=false" +//! RUN entry: "ETSGLOBAL::main" + function toString0(str: String): String { return new StringBuilder(str).toString(); // applied diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch.sts b/static_core/plugins/ets/tests/checked/ets_try_catch.sts index 73fd84237..4883df81a 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch.sts @@ -24,13 +24,17 @@ //! CHECKER Try Catch Resolving AOT Optimize when default catch is outside //! SKIP_IF @architecture == "arm32" -//! RUN_AOT options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" +//! RUN_PAOC options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" //! METHOD "MultipleCatch::__noinline__multipleCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 //! PASS_AFTER "TryCatchResolving" //! INST_COUNT "Throw",2 +//! CHECKER Sanity check in LLVM AOT +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" + class Exception0 extends Exception {} class Exception1 extends Exception {} diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch1.sts b/static_core/plugins/ets/tests/checked/ets_try_catch1.sts index 0bb497142..c6ff15b06 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch1.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch1.sts @@ -24,13 +24,17 @@ //! CHECKER Try Catch Resolving AOT Optimize with default catch only //! SKIP_IF @architecture == "arm32" -//! RUN_AOT options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" +//! RUN_PAOC options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" //! METHOD "MultipleCatch::__noinline__multipleCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 //! PASS_AFTER "TryCatchResolving" //! INST_COUNT "Throw",2 +//! CHECKER Sanity check in LLVM AOT +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" + class Exception0 extends Exception {} class Exception1 extends Exception {} diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch10.sts b/static_core/plugins/ets/tests/checked/ets_try_catch10.sts index d90c7a344..8c789e2f0 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch10.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch10.sts @@ -25,7 +25,7 @@ //! CHECKER Try Catch Resolving AOT IfImm is not replaced by DeoptimizeIf //! SKIP_IF @architecture == "arm32" -//! RUN_AOT options: "--compiler-regex=IfCatch::__noinline__ifCatch" +//! RUN_PAOC options: "--compiler-regex=IfCatch::__noinline__ifCatch" //! METHOD "IfCatch::__noinline__ifCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 @@ -33,6 +33,10 @@ //! INST_COUNT "Throw",2 //! INST_NOT "DeoptimizeIf" +//! CHECKER Sanity check in LLVM AOT +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex=IfCatch::__noinline__ifCatch" + class Exception0 extends Exception {} class Exception1 extends Exception {} diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch11.sts b/static_core/plugins/ets/tests/checked/ets_try_catch11.sts index da43a2d7e..1d3077d90 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch11.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch11.sts @@ -25,7 +25,7 @@ //! CHECKER Try Catch Resolving AOT IfImm is not replaced by DeoptimizeIf //! SKIP_IF @architecture == "arm32" -//! RUN_AOT options: "--compiler-regex=IfCatch::__noinline__ifCatch" +//! RUN_PAOC options: "--compiler-regex=IfCatch::__noinline__ifCatch" //! METHOD "IfCatch::__noinline__ifCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 @@ -33,6 +33,10 @@ //! INST_COUNT "Throw",2 //! INST_NOT "DeoptimizeIf" +//! CHECKER Sanity check in LLVM AOT +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex=IfCatch::__noinline__ifCatch" + class Exception0 extends Exception {} class Exception1 extends Exception {} diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch12.sts b/static_core/plugins/ets/tests/checked/ets_try_catch12.sts index e48504ccb..6f8024ec1 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch12.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch12.sts @@ -25,7 +25,7 @@ //! CHECKER Try Catch Resolving AOT IfImm is not replaced by DeoptimizeIf //! SKIP_IF @architecture == "arm32" -//! RUN_AOT options: "--compiler-regex=IfCatch::__noinline__ifCatch" +//! RUN_PAOC options: "--compiler-regex=IfCatch::__noinline__ifCatch" //! METHOD "IfCatch::__noinline__ifCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 @@ -33,6 +33,10 @@ //! INST_COUNT "Throw",2 //! INST_NOT "DeoptimizeIf" +//! CHECKER Sanity check in LLVM AOT +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex=IfCatch::__noinline__ifCatch" + class Exception0 extends Exception {} class Exception1 extends Exception {} diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch13.sts b/static_core/plugins/ets/tests/checked/ets_try_catch13.sts index 92159cb03..bf00de59a 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch13.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch13.sts @@ -25,7 +25,7 @@ //! CHECKER Try Catch Resolving AOT IfImm is not replaced by DeoptimizeIf //! SKIP_IF @architecture == "arm32" -//! RUN_AOT options: "--compiler-regex=IfCatch::__noinline__ifCatch" +//! RUN_PAOC options: "--compiler-regex=IfCatch::__noinline__ifCatch" //! METHOD "IfCatch::__noinline__ifCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 @@ -33,6 +33,10 @@ //! INST_COUNT "Throw",2 //! INST_NOT "DeoptimizeIf" +//! CHECKER Sanity check in LLVM AOT +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex=IfCatch::__noinline__ifCatch" + class Exception0 extends Exception {} class Exception1 extends Exception {} diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch14.sts b/static_core/plugins/ets/tests/checked/ets_try_catch14.sts index 5bdf7a3ee..812e38471 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch14.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch14.sts @@ -25,7 +25,7 @@ //! CHECKER Try Catch Resolving AOT IfImm is not replaced by DeoptimizeIf //! SKIP_IF @architecture == "arm32" -//! RUN_AOT options: "--compiler-regex=IfCatch::__noinline__ifCatch" +//! RUN_PAOC options: "--compiler-regex=IfCatch::__noinline__ifCatch" //! METHOD "IfCatch::__noinline__ifCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 @@ -33,6 +33,10 @@ //! INST_COUNT "Throw",2 //! INST_NOT "DeoptimizeIf" +//! CHECKER Sanity check in LLVM AOT +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex=IfCatch::__noinline__ifCatch" + class Exception0 extends Exception {} class Exception1 extends Exception {} diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch15.sts b/static_core/plugins/ets/tests/checked/ets_try_catch15.sts index a04e98bcd..2aadc5247 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch15.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch15.sts @@ -25,7 +25,7 @@ //! CHECKER Try Catch Resolving AOT IfImm is not replaced by DeoptimizeIf //! SKIP_IF @architecture == "arm32" -//! RUN_AOT options: "--compiler-regex=ETSGLOBAL::__noinline__test" +//! RUN_PAOC options: "--compiler-regex=ETSGLOBAL::__noinline__test" //! METHOD "ETSGLOBAL::__noinline__test" //! PASS_AFTER "Inline" //! INST "Throw" @@ -33,6 +33,10 @@ //! INST "Throw" //! INST_NOT "DeoptimizeIf" +//! CHECKER Sanity check in LLVM AOT +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex=ETSGLOBAL::__noinline__test" + class Ex extends Exception {} let ex: Ex = new Ex() diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch2.sts b/static_core/plugins/ets/tests/checked/ets_try_catch2.sts index 66699b267..447ca165c 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch2.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch2.sts @@ -24,13 +24,17 @@ //! CHECKER Try Catch Resolving AOT Optimize with partial and default catches //! SKIP_IF @architecture == "arm32" -//! RUN_AOT options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" +//! RUN_PAOC options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" //! METHOD "MultipleCatch::__noinline__multipleCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 //! PASS_AFTER "TryCatchResolving" //! INST_COUNT "Throw",2 +//! CHECKER Sanity check in LLVM AOT +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" + class Exception0 extends Exception {} class Exception1 extends Exception {} diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch3.sts b/static_core/plugins/ets/tests/checked/ets_try_catch3.sts index 1b05aaa12..627257f7a 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch3.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch3.sts @@ -24,13 +24,17 @@ //! CHECKER Try Catch Resolving AOT Optimize with default catch on the same level //! SKIP_IF @architecture == "arm32" -//! RUN_AOT options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" +//! RUN_PAOC options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" //! METHOD "MultipleCatch::__noinline__multipleCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",3 //! PASS_AFTER "TryCatchResolving" //! INST_COUNT "Throw",3 +//! CHECKER Sanity check in LLVM AOT +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" + class Exception0 extends Exception {} class Exception1 extends Exception {} class Exception2 extends Exception {} diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch5.sts b/static_core/plugins/ets/tests/checked/ets_try_catch5.sts index dbc55a986..7f065556c 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch5.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch5.sts @@ -24,13 +24,17 @@ //! CHECKER Try Catch Resolving AOT with with exception instances as function parameters //! SKIP_IF @architecture == "arm32" -//! RUN_AOT options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" +//! RUN_PAOC options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" //! METHOD "MultipleCatch::__noinline__multipleCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 //! PASS_AFTER "TryCatchResolving" //! INST_COUNT "Throw",2 +//! CHECKER Sanity check in LLVM AOT +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" + class Exception0 extends Exception {} class Exception1 extends Exception {} diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch6.sts b/static_core/plugins/ets/tests/checked/ets_try_catch6.sts index dc65675d7..60635efbc 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch6.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch6.sts @@ -24,13 +24,17 @@ //! CHECKER Try Catch Resolving AOT with with exception instances as function parameters //! SKIP_IF @architecture == "arm32" -//! RUN_AOT options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" +//! RUN_PAOC options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" //! METHOD "MultipleCatch::__noinline__multipleCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",3 //! PASS_AFTER "TryCatchResolving" //! INST_COUNT "Throw",3 +//! CHECKER Sanity check in LLVM AOT +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" + class Exception0 extends Exception {} class Exception1 extends Exception {} class Exception2 extends Exception {} diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch7.sts b/static_core/plugins/ets/tests/checked/ets_try_catch7.sts index 5a0819e61..f3adadc3c 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch7.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch7.sts @@ -24,13 +24,17 @@ //! CHECKER Try Catch Resolving AOT with with exception instances as function parameters //! SKIP_IF @architecture == "arm32" -//! RUN_AOT options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" +//! RUN_PAOC options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" //! METHOD "MultipleCatch::__noinline__multipleCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 //! PASS_AFTER "TryCatchResolving" //! INST_COUNT "Throw",2 +//! CHECKER Sanity check in LLVM AOT +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex=MultipleCatch::__noinline__multipleCatch" + class Exception0 extends Exception {} class MultipleCatch { diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch8.sts b/static_core/plugins/ets/tests/checked/ets_try_catch8.sts index 210bf270b..9ef264e2e 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch8.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch8.sts @@ -27,13 +27,17 @@ //! CHECKER Try Catch Resolving AOT with with exception instances as function parameters //! SKIP_IF @architecture == "arm32" -//! RUN_AOT options: "--compiler-regex=MultipleCatch::multipleCatch" +//! RUN_PAOC options: "--compiler-regex=MultipleCatch::multipleCatch" //! METHOD "MultipleCatch::multipleCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 //! PASS_AFTER "TryCatchResolving" //! INST_COUNT "Throw",2 +//! CHECKER Sanity check in LLVM AOT +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex=MultipleCatch::multipleCatch" + class Exception0 extends Exception {} class MultipleCatch { diff --git a/static_core/plugins/ets/tests/checked/ets_try_catch9.sts b/static_core/plugins/ets/tests/checked/ets_try_catch9.sts index 6aedea5bc..3167246bd 100644 --- a/static_core/plugins/ets/tests/checked/ets_try_catch9.sts +++ b/static_core/plugins/ets/tests/checked/ets_try_catch9.sts @@ -25,7 +25,7 @@ //! CHECKER Try Catch Resolving AOT IfImm is not replaced by DeoptimizeIf //! SKIP_IF @architecture == "arm32" -//! RUN_AOT options: "--compiler-regex=IfCatch::__noinline__ifCatch" +//! RUN_PAOC options: "--compiler-regex=IfCatch::__noinline__ifCatch" //! METHOD "IfCatch::__noinline__ifCatch" //! PASS_AFTER "Inline" //! INST_COUNT "Throw",2 @@ -33,6 +33,10 @@ //! INST_COUNT "Throw",2 //! INST_NOT "DeoptimizeIf" +//! CHECKER Sanity check in LLVM AOT +//! SKIP_IF @architecture == "arm32" +//! RUN_LLVM options: "--compiler-regex=IfCatch::__noinline__ifCatch" + class Exception0 extends Exception {} class Exception1 extends Exception {} diff --git a/static_core/plugins/ets/tests/interop_js/tests/checked/js_call/js_call.sts b/static_core/plugins/ets/tests/interop_js/tests/checked/js_call/js_call.sts index 10f9e5004..bc1997ab0 100644 --- a/static_core/plugins/ets/tests/interop_js/tests/checked/js_call/js_call.sts +++ b/static_core/plugins/ets/tests/interop_js/tests/checked/js_call/js_call.sts @@ -647,6 +647,7 @@ function jscallEtsObject(): int { //! INST_NOT /CallStatic.*jsnew::invoke/ //! INST "Intrinsic.JSRuntimeGetPropertyDouble" //! RUN entry: "jsLoadFromPrototype" +//! LLVM_IGNORE reason: 'No stackrange intrinsics support' function jsLoadFromPrototype(): int { for (let i = 1; i <= 5; i++) { @@ -672,6 +673,7 @@ function jsLoadFromPrototype(): int { //! INST_NOT /CallStatic.*jsnew::invoke/ //! INST "Intrinsic.JSRuntimeGetPropertyDouble" //! RUN entry: "jsLoadOverridden" +//! LLVM_IGNORE reason: 'No stackrange intrinsics support' function jsLoadOverridden(): int { for (let i = 1; i <= 5; i++) { @@ -699,6 +701,7 @@ function jsLoadOverridden(): int { //! INST_NOT /CallStatic.*jscall::invoke/ //! INST "Intrinsic.JSRuntimeGetValueString" //! RUN entry: "jsCallFromPrototype" +//! LLVM_IGNORE reason: 'No stackrange intrinsics support' function jsCallFromPrototype(): int { for (let i = 1; i <= 5; i++) { @@ -719,6 +722,7 @@ function jsCallFromPrototype(): int { //! RUN_PAOC options: "--compiler-regex=ETSGLOBAL::jscallOverridden" //! METHOD "jscallOverridden" //! RUN entry: "jscallOverridden" +//! LLVM_IGNORE reason: 'No stackrange intrinsics support' function jscallOverridden(): int { for (let i = 1; i <= 5; i++) { diff --git a/static_core/tests/checked/aot.pa b/static_core/tests/checked/aot.pa index 19f8295ea..350ddd5a5 100644 --- a/static_core/tests/checked/aot.pa +++ b/static_core/tests/checked/aot.pa @@ -13,34 +13,15 @@ #! CHECKER All methods found -#! RUN_PAOC options: "--compiler-inlining false" +#! RUN_AOT options: "--compiler-inlining false" #! RUN options: "", entry: "_GLOBAL::main", result: 52 #! EVENT_NOT /Inline.*/ #! EVENT "AotEntrypointFound,_GLOBAL::func1" #! EVENT "AotEntrypointFound,_GLOBAL::func2" #! EVENT "AotEntrypointFound,_GLOBAL::func3" -#! CHECKER All methods found - LLVM -#! RUN_LLVM options: "--compiler-inlining false" -#! RUN options: "", entry: "_GLOBAL::main", result: 52 -#! EVENT_NOT /Inline.*/ -#! EVENT "AotEntrypointFound,_GLOBAL::func1" -#! EVENT "AotEntrypointFound,_GLOBAL::func2" -#! EVENT "AotEntrypointFound,_GLOBAL::func3" - - #! CHECKER Various methods compiled -#! RUN_PAOC options: "--compiler-inlining false --compiler-regex '(_GLOBAL::func[13]|Test::f[23])'" -#! RUN options: "", entry: "_GLOBAL::main2", result: 58 -#! EVENT "AotEntrypointFound,_GLOBAL::func1" -#! EVENT "AotEntrypointFound,_GLOBAL::func3" -#! EVENT_NOT "AotEntrypointFound,_GLOBAL::func2" -#! EVENT "AotEntrypointFound,Test::f2" -#! EVENT "AotEntrypointFound,Test::f3" -#! EVENT_NOT "AotEntrypointFound,Test::f1" - -#! CHECKER Various methods compiled - LLVM -#! RUN_LLVM options: "--compiler-inlining false --compiler-regex '(_GLOBAL::func[13]|Test::f[23])'" +#! RUN_AOT options: "--compiler-inlining false --compiler-regex '(_GLOBAL::func[13]|Test::f[23])'" #! RUN options: "", entry: "_GLOBAL::main2", result: 58 #! EVENT "AotEntrypointFound,_GLOBAL::func1" #! EVENT "AotEntrypointFound,_GLOBAL::func3" diff --git a/static_core/tests/checked/cast_bool.pa b/static_core/tests/checked/cast_bool.pa index ae88cd9a3..2ebd36532 100644 --- a/static_core/tests/checked/cast_bool.pa +++ b/static_core/tests/checked/cast_bool.pa @@ -15,12 +15,9 @@ #! RUN force_jit: true, options: "", entry: "_GLOBAL::main_all" #! EVENT /Compilation,_GLOBAL::main_all,.*COMPILED/ -#! CHECKER Check that cast in bool work for all arch at Regular AOT -#! RUN_PAOC options: "" -#! RUN entry: "_GLOBAL::main_all" - -#! CHECKER Check that cast in bool work for all arch at LLVM AOT -#! RUN_LLVM options: "" +#! CHECKER Check that cast in bool work for all arch in AOT +#! SKIP_IF @architecture == "arm32" +#! RUN_AOT options: "" #! RUN entry: "_GLOBAL::main_all" .function u1 main_all() { diff --git a/static_core/tests/checked/checkcast_elimination_test.pa b/static_core/tests/checked/checkcast_elimination_test.pa index 77408fadd..f28f6f76f 100644 --- a/static_core/tests/checked/checkcast_elimination_test.pa +++ b/static_core/tests/checked/checkcast_elimination_test.pa @@ -24,16 +24,8 @@ #! INST_NOT "CheckCast" #! INST "Deoptimize" -#! CHECKER CheckCast Elimination applied, replaced on deoptimize at Regular AOT. -#! RUN_PAOC options: "--compiler-regex=_GLOBAL.*" -#! METHOD "_GLOBAL::main1" -#! PASS_AFTER "Inline" -#! INST_NOT "CheckCast" -#! INST "Deoptimize" -#! RUN entry: "_GLOBAL::main1" - -#! CHECKER CheckCast Elimination applied, replaced on deoptimize at LLVM AOT. -#! RUN_LLVM options: "--compiler-regex=_GLOBAL.*" +#! CHECKER CheckCast eliminated and replaced with deoptimize +#! RUN_AOT options: "--compiler-regex=_GLOBAL.*" #! METHOD "_GLOBAL::main1" #! PASS_AFTER "Inline" #! INST_NOT "CheckCast" @@ -68,15 +60,8 @@ catch_block2_begin: #! PASS_AFTER "Inline" #! INST_NOT "CheckCast" -#! CHECKER CheckCast Elimination applied, remove redundant checkcast at Regular AOT. -#! RUN_PAOC options: "--compiler-regex=_GLOBAL.*" -#! METHOD "_GLOBAL::main2" -#! PASS_AFTER "Inline" -#! INST_NOT "CheckCast" -#! RUN entry: "_GLOBAL::main2" - -#! CHECKER CheckCast Elimination applied, remove redundant checkcast at LLVM AOT. -#! RUN_LLVM options: "--compiler-regex=_GLOBAL.*" +#! CHECKER Redundant CheckCast removed in AOT. +#! RUN_AOT options: "--compiler-regex=_GLOBAL.*" #! METHOD "_GLOBAL::main2" #! PASS_AFTER "Inline" #! INST_NOT "CheckCast" diff --git a/static_core/tests/checked/checker.rb b/static_core/tests/checked/checker.rb index 2008707ff..d93ee8fb3 100755 --- a/static_core/tests/checked/checker.rb +++ b/static_core/tests/checked/checker.rb @@ -17,6 +17,7 @@ require 'ostruct' require 'logger' require 'fileutils' require 'open3' +require 'set' options = OpenStruct.new OptionParser.new do |opts| @@ -176,6 +177,8 @@ class Checker @architecture = options.arch @aot_file = '' @llvm_paoc = false + @entries = [] + @llvm_ignore = false # Events scope for 'events.csv' @events_scope = nil @@ -201,6 +204,30 @@ class Checker @code << line + "\n" end + def entries() + @entries + end + + def aot() + @aot_file != '' + end + + def llvm_aot() + @llvm_paoc + end + + def llvm_ignore() + @llvm_ignore + end + + def name() + @name + end + + def LLVM_IGNORE(**args) + @llvm_ignore = true + end + def RUN(**args) expected_result = 0 aborted_sig = 0 @@ -231,6 +258,7 @@ class Checker #{aot_arg} #{@args} --events-output=csv --compiler-dump --compiler-disasm-dump:single-file #{@options.test_file} #{entry}" $curr_cmd = "#{env} #{cmd}" log.debug "Panda command: #{$curr_cmd}" + entries << entry # See note on exec in RUN_PAOC output, status = Open3.capture2e("#{env} exec #{cmd}", chdir: @cwd.to_s) @@ -380,6 +408,7 @@ class Checker raise SkipException unless @options.with_llvm args[:options] << " --paoc-mode=llvm " + set_llvm_paoc() RUN_PAOC(**args) end @@ -660,15 +689,19 @@ def read_checks(options) command_token = /[ ]*#{options.command_token}(.*)/ checker_start = /[ ]*#{options.command_token} CHECKER[ ]*(.*)/ disabled_checker_start = /[ ]*#{options.command_token} DISABLED_CHECKER[ ]*(.*)/ + has_run_aot = false File.readlines(options.source).each do |line| if check unless line.start_with? command_token check = nil check_llvm = nil + has_run_aot = false next end raise "No space between two checkers: '#{line.strip}'" if line.start_with? checker_start if line.include? "RUN_AOT" + raise "Multiple RUN_AOT commands are not supported. Checker: '#{check.name()}'" unless !has_run_aot + has_run_aot = true checks << check_llvm end check.append_line(command_token.match(line)[1]) unless check == :disabled_check @@ -686,6 +719,7 @@ def read_checks(options) else raise "Line '#{line.strip}' does not belong to any checker" unless line.start_with? disabled_checker_start check = :disabled_check + has_run_aot = false next end end @@ -693,8 +727,54 @@ def read_checks(options) checks end +def validate_llvm_runs(checks, options) + if !options[:with_llvm] + return + end + llvm_checks = Set[] + aot_checks = Set[] + llvm_aot = false + aot = false + + for check in checks do + if check.llvm_ignore() + next + end + if check.aot() + aot |= !check.llvm_aot() + llvm_aot |= check.llvm_aot() + + if !check.llvm_aot() + aot_checks += check.entries() + else + llvm_checks += check.entries() + end + end + end + + message = "'#{options.source}' has:\n" + missing_llvm_aot_run = false + should_fail = false + if aot && !llvm_aot + message << "\t1. Missing LLVM AOT run. Please, add at least one RUN_LLVM (or RUN_AOT) command into the test file" + should_fail = true + missing_llvm_aot_run = true + end + aot_checks = aot_checks.reject { | e | llvm_checks.include?(e) } + if !aot_checks.empty? + message << (missing_llvm_aot_run ? "\n\t2." : "\t1.") << " Missing LLVM AOT RUNs. Please, add RUN_LLVM and RUN commands with entries: #{aot_checks}\n" + should_fail = true + end + if should_fail + message << "Or use 'LLVM_IGNORE' command in the checker(-s) with entry(-es) #{aot_checks} to suppress this error" + end + raise message unless !should_fail +end + def main(options) - read_checks(options).each(&:run) + checks = read_checks(options) + checks.each(&:run) + validate_llvm_runs(checks, options) 0 end diff --git a/static_core/tests/checked/cleanup_sso.pa b/static_core/tests/checked/cleanup_sso.pa index eedf6871f..085804801 100644 --- a/static_core/tests/checked/cleanup_sso.pa +++ b/static_core/tests/checked/cleanup_sso.pa @@ -31,6 +31,9 @@ #! PASS_AFTER "ChecksElimination" #! INST_NOT "SaveStateOsr" +#! CHECKER Sanity check for llvm aot +#! RUN_LLVM options: "" + # We generate deoptimize using BoundCheck (store to array with index -3) # i32 i; # for(i=0; i<5; i++) array[-3]=i; diff --git a/static_core/tests/checked/const_array_test.pa b/static_core/tests/checked/const_array_test.pa index fb703d748..2584c8ad2 100644 --- a/static_core/tests/checked/const_array_test.pa +++ b/static_core/tests/checked/const_array_test.pa @@ -26,11 +26,7 @@ #! INST_NOT "StoreArray" #! CHECKER Split ConstArray AOT -#! RUN_PAOC options: "--compiler-regex=_GLOBAL::main --compiler-unfold-const-array-max-size=2" -#! RUN entry: "_GLOBAL::main" - -#! CHECKER Split ConstArray LLVM -#! RUN_LLVM options: "--compiler-regex=_GLOBAL::main --compiler-unfold-const-array-max-size=2" +#! RUN_AOT options: "--compiler-regex=_GLOBAL::main --compiler-unfold-const-array-max-size=2" #! RUN entry: "_GLOBAL::main" #! CHECKER Fill ConstArray @@ -44,11 +40,7 @@ #! INST_NOT "LoadConstArray" #! CHECKER Fill ConstArray AOT -#! RUN_PAOC options: "--compiler-regex=_GLOBAL::main --compiler-unfold-const-array-max-size=4" -#! RUN entry: "_GLOBAL::main" - -#! CHECKER Fill ConstArray LLVM -#! RUN_LLVM options: "--compiler-regex=_GLOBAL::main --compiler-unfold-const-array-max-size=4" +#! RUN_AOT options: "--compiler-regex=_GLOBAL::main --compiler-unfold-const-array-max-size=4" #! RUN entry: "_GLOBAL::main" .record panda.String diff --git a/static_core/tests/checked/cross_peephole.pa b/static_core/tests/checked/cross_peephole.pa index c1fc6d265..416729ee8 100644 --- a/static_core/tests/checked/cross_peephole.pa +++ b/static_core/tests/checked/cross_peephole.pa @@ -13,22 +13,23 @@ # Check cross-compiling only on amd64 -#! CHECKER Compiling a method for arm/arm64 on amd64 in JIT +#! CHECKER Compiling a method for arm on amd64 in JIT #! SKIP_IF @architecture != "x64" #! RUN force_jit: true, options: "--compiler-cross-arch=arm", entry: "_GLOBAL::main" #! EVENT /Compilation,_GLOBAL::main,.*DROPPED/ + +#! CHECKER Compiling a method for arm64 on amd64 in JIT +#! SKIP_IF @architecture != "x64" #! RUN force_jit: true, options: "--compiler-cross-arch=arm64", entry: "_GLOBAL::main" #! EVENT /Compilation,_GLOBAL::main,.*DROPPED/ -#! CHECKER Compiling a method arm/arm64 on amd64 in AOT +#! CHECKER Compiling a method arm on amd64 in AOT #! SKIP_IF @architecture != "x64" #! RUN_PAOC options: "--compiler-cross-arch=arm" -#! RUN_PAOC options: "--compiler-cross-arch=arm64" -#! CHECKER Compiling a method arm/arm64 on amd64 in LLVM AOT +#! CHECKER Compiling a method arm64 on amd64 in AOT #! SKIP_IF @architecture != "x64" -#! RUN_LLVM options: "--compiler-cross-arch=arm64" - +#! RUN_AOT options: "--compiler-cross-arch=arm64" # Check, that need second peephole for lowering diff --git a/static_core/tests/checked/deoptimize_compare.pa b/static_core/tests/checked/deoptimize_compare.pa index 9019f563a..6a7ca77d5 100644 --- a/static_core/tests/checked/deoptimize_compare.pa +++ b/static_core/tests/checked/deoptimize_compare.pa @@ -36,6 +36,9 @@ #! INST "DeoptimizeIf" #! INST "DeoptimizeCompare" +#! CHECKER Sanity check for LLVM AOT +#! RUN_LLVM options: "" + .function i32 sum(i32[] a0, i32 a1) <> { movi v0, 0x0 mov v3, v0 diff --git a/static_core/tests/checked/disasm_and_log_demo.pa b/static_core/tests/checked/disasm_and_log_demo.pa index 1fcf9ab16..61f5919cb 100644 --- a/static_core/tests/checked/disasm_and_log_demo.pa +++ b/static_core/tests/checked/disasm_and_log_demo.pa @@ -16,7 +16,7 @@ #! EVENT /Compilation,_GLOBAL::main,.*COMPILED/ #! CHECKER Check that MmapMemPool: Try to free arena Regular AOT -#! RUN_PAOC options: "--compiler-disasm-dump" +#! RUN_AOT options: "--compiler-disasm-dump" #! RUN entry: "_GLOBAL::main" .function u1 main (){ diff --git a/static_core/tests/checked/external_call/external-call-01.pa b/static_core/tests/checked/external_call/external-call-01.pa index f141b38fa..75dcd0707 100644 --- a/static_core/tests/checked/external_call/external-call-01.pa +++ b/static_core/tests/checked/external_call/external-call-01.pa @@ -11,12 +11,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -#! CHECKER External call Regular AOT -#! RUN_PAOC options: "--paoc-panda-files=../external-call-02.bin" +#! CHECKER External call AOT +#! RUN_AOT options: "--paoc-panda-files=../external-call-02.bin" #! RUN options: "", entry: "_GLOBAL::main" -#! CHECKER External call LLVM AOT -#! RUN_LLVM options: "--compiler-non-optimizing=true --paoc-panda-files=../external-call-02.bin" +#! CHECKER External call AOT, no-opt +#! RUN_AOT options: "--compiler-non-optimizing=true --paoc-panda-files=../external-call-02.bin" #! RUN options: "", entry: "_GLOBAL::main" .record Functional { diff --git a/static_core/tests/checked/external_inline/a.pa b/static_core/tests/checked/external_inline/a.pa index 7404d6858..f1f2fd3bd 100644 --- a/static_core/tests/checked/external_inline/a.pa +++ b/static_core/tests/checked/external_inline/a.pa @@ -12,11 +12,7 @@ # limitations under the License. #! CHECKER External Inline -#! RUN_PAOC options: "--paoc-panda-files ../b.bin" -#! RUN options: "", entry: "_GLOBAL::main", result: 10 - -#! CHECKER External Inline LLVM -#! RUN_LLVM options: "--paoc-panda-files ../b.bin" +#! RUN_AOT options: "--paoc-panda-files ../b.bin" #! RUN options: "", entry: "_GLOBAL::main", result: 10 .record InlineTestExt diff --git a/static_core/tests/checked/float_intrinsic.pa b/static_core/tests/checked/float_intrinsic.pa index 8250cab80..2350412f7 100644 --- a/static_core/tests/checked/float_intrinsic.pa +++ b/static_core/tests/checked/float_intrinsic.pa @@ -31,6 +31,10 @@ #! INST "Intrinsic.MathCalculateFloat" #! RUN options: "--compiler-enable-jit=false", entry: "_GLOBAL::main" +#! CHECKER Check call intrinsic which returns float value, through runtime bridge (LLVM AOT) +#! RUN_LLVM options: "--compiler-regex='_GLOBAL::test.*'" +#! RUN options: "--compiler-enable-jit=false", entry: "_GLOBAL::main" + .record Math .function f64 Math.calculateDouble(u32 a0, f64 a1) diff --git a/static_core/tests/checked/force_an.pa b/static_core/tests/checked/force_an.pa index b251eff26..f6befa287 100644 --- a/static_core/tests/checked/force_an.pa +++ b/static_core/tests/checked/force_an.pa @@ -12,12 +12,12 @@ # limitations under the License. #! CHECKER Enable an -#! RUN_PAOC options: "" +#! RUN_AOT options: "" #! RUN options: "--enable-an", entry: "_GLOBAL::main" #! EVENT /AotLoadedForClass,.*,_GLOBAL/ #! CHECKER Enable an force -#! RUN_PAOC options: "" +#! RUN_AOT options: "" #! RUN options: "--enable-an:force", entry: "_GLOBAL::main", abort: 6 #! EVENT_NOT /AotLoadedForClass,.*,_GLOBAL/ diff --git a/static_core/tests/checked/force_unresolved_option.pa b/static_core/tests/checked/force_unresolved_option.pa index ff2a4565e..f427e168d 100644 --- a/static_core/tests/checked/force_unresolved_option.pa +++ b/static_core/tests/checked/force_unresolved_option.pa @@ -31,7 +31,7 @@ } #! CHECKER Option compiler-force-unresolved is off -#! RUN_PAOC options: "--compiler-inlining=false --compiler-non-optimizing=true" +#! RUN_AOT options: "--compiler-inlining=false --compiler-non-optimizing=true" #! METHOD "_GLOBAL::main" #! PASS_AFTER "IrBuilder" #! INST_NOT "ResolveStatic" @@ -53,7 +53,7 @@ #! INST_NEXT "StoreObject" #! CHECKER Option compiler-force-unresolved is on -#! RUN_PAOC options: "--compiler-force-unresolved=true --compiler-inlining=false --compiler-non-optimizing=true" +#! RUN_AOT options: "--compiler-force-unresolved=true --compiler-inlining=false --compiler-non-optimizing=true" #! METHOD "_GLOBAL::main" #! PASS_AFTER "IrBuilder" #! INST_NOT "CallStatic" diff --git a/static_core/tests/checked/ifcvt.pa b/static_core/tests/checked/ifcvt.pa index 100e10496..148d0aa1f 100644 --- a/static_core/tests/checked/ifcvt.pa +++ b/static_core/tests/checked/ifcvt.pa @@ -47,6 +47,16 @@ # PASS_AFTER("IfConversion") # TRUE(temp > BLOCK_COUNT()) +#! CHECKER Sanity check in LLVM AOT +#! SKIP_IF @architecture == "arm32" +#! RUN_LLVM options: "" +#! RUN options: "", entry: "_GLOBAL::main" + +#! CHECKER Sanity check in LLVM AOT main1 +#! SKIP_IF @architecture == "arm32" +#! RUN_LLVM options: "" +#! RUN options: "", entry: "_GLOBAL::main1" + .function i32 main () <> { movi v0, 0 movi v1, 10 diff --git a/static_core/tests/checked/implicit_nullcheck_tests.pa b/static_core/tests/checked/implicit_nullcheck_tests.pa index 2f83c429f..752bf1d79 100644 --- a/static_core/tests/checked/implicit_nullcheck_tests.pa +++ b/static_core/tests/checked/implicit_nullcheck_tests.pa @@ -74,6 +74,10 @@ #! EVENT_NEXT /Exception,.*__noinline__call_ldobj_obj.*NULL_CHECK/ #! EVENT_NEXT /Exception,.*__noinline__call_stobj_obj.*NULL_CHECK/ +#! CHECKER Sanity check LLVM AOT +#! RUN_LLVM options: "" +#! RUN options: "", entry: "_GLOBAL::main" + #! CHECKER Sanity check in interpreter #! SKIP_IF @architecture == "arm32" #! RUN options: "--compiler-enable-jit=false --interpreter-type=irtoc", entry: "_GLOBAL::main" diff --git a/static_core/tests/checked/inline-external-constructor.pa b/static_core/tests/checked/inline-external-constructor.pa index 95d09889d..0dc0292e7 100644 --- a/static_core/tests/checked/inline-external-constructor.pa +++ b/static_core/tests/checked/inline-external-constructor.pa @@ -17,6 +17,10 @@ #! RUN_PAOC options: "" #! EVENT /Inline,_GLOBAL::bar,Test::.ctor,.*STATIC,SUCCESS/ +#! CHECKER LLVM AOT sanity check +#! SKIP_IF @architecture == "arm32" +#! RUN_LLVM options: "" + .record Test .function void Test.init(Test a0) diff --git a/static_core/tests/checked/inline.pa b/static_core/tests/checked/inline.pa index f8cd3e24e..d84c1cba8 100644 --- a/static_core/tests/checked/inline.pa +++ b/static_core/tests/checked/inline.pa @@ -37,6 +37,10 @@ #! EVENT_NEXT /Inline,Test1::main,_GLOBAL::small_func,.*STATIC,SUCCESS/ #! RUN entry: "Test1::main" +#! CHECKER LLVM AOT sanity check Test1::main +#! RUN_LLVM options: "" +#! RUN entry: "Test1::main" + .record Test1 {} .function i32 func(i32 a0) { @@ -77,6 +81,10 @@ #! EVENTS_COUNT /Inline,_GLOBAL::func_rec,_GLOBAL::func_rec,.*STATIC,SUCCESS/, 1 #! RUN entry: "Test1::main_depth" +#! CHECKER LLVM AOT sanity check for Test1::main_depth +#! RUN_LLVM options: "" +#! RUN entry: "Test1::main_depth" + .function i32 func_rec(i32 a0) { lda a0 jeqz exit @@ -798,6 +806,10 @@ error_exit_14: #! EVENT_NOT /Inline,B1::func__noinline__,A1::func,.*VIRTUAL,SUCCESS/ #! RUN options: "", entry: "Test5::main" +#! CHECKER LLVM AOT sanity check Test5::main +#! RUN_LLVM options: "" +#! RUN options: "", entry: "Test5::main" + .record Test5 {} .record A1 {} .record B1 {} diff --git a/static_core/tests/checked/inline_small.pa b/static_core/tests/checked/inline_small.pa index ff29d5fc7..a314e909b 100644 --- a/static_core/tests/checked/inline_small.pa +++ b/static_core/tests/checked/inline_small.pa @@ -39,6 +39,10 @@ #! EVENTS_COUNT /Inline,A::main,A::Get,.*STATIC,SUCCESS/, 1 #! RUN entry: "A::main" +#! CHECKER Inline in LLVM AOT +#! RUN_LLVM options: "" +#! RUN entry: "A::main" + .record D { i32 val_ } diff --git a/static_core/tests/checked/irreducible_loop_test.pa b/static_core/tests/checked/irreducible_loop_test.pa index 82ff336dc..706008b44 100644 --- a/static_core/tests/checked/irreducible_loop_test.pa +++ b/static_core/tests/checked/irreducible_loop_test.pa @@ -12,17 +12,12 @@ # limitations under the License. #! CHECKER Irreducible loop test -#! RUN_PAOC options: "--compiler-regex=.*try_to_reproduce.*" -#! RUN options: "", entry: "_GLOBAL::main", result: 1 -#! EVENT /AotEntrypointFound,_GLOBAL::try_to_reproduce/ - -#! CHECKER Irreducible loop test LLVM AOT -#! RUN_LLVM options: "--compiler-regex=.*try_to_reproduce.*" +#! RUN_AOT options: "--compiler-regex=.*try_to_reproduce.*" #! RUN options: "", entry: "_GLOBAL::main", result: 1 #! EVENT /AotEntrypointFound,_GLOBAL::try_to_reproduce/ #! CHECKER Irreducible loop test with reg maps on safepoints -#! RUN_PAOC options: "--compiler-regex=.*try_to_reproduce.* --compiler-safe-points-require-reg-map=true" +#! RUN_AOT options: "--compiler-regex=.*try_to_reproduce.* --compiler-safe-points-require-reg-map=true" #! RUN options: "", entry: "_GLOBAL::main", result: 1 #! EVENT /AotEntrypointFound,_GLOBAL::try_to_reproduce/ diff --git a/static_core/tests/checked/ldarray_obj.pa b/static_core/tests/checked/ldarray_obj.pa index c7be88e13..d81f4f3ec 100644 --- a/static_core/tests/checked/ldarray_obj.pa +++ b/static_core/tests/checked/ldarray_obj.pa @@ -17,11 +17,7 @@ #! METHOD "_GLOBAL::test" #! CHECKER Regular AOT rewrite index value -#! RUN_PAOC options: "" -#! RUN entry: "_GLOBAL::main", result: 1 - -#! CHECKER LLVM AOT rewrite index value -#! RUN_LLVM options: "" +#! RUN_AOT options: "" #! RUN entry: "_GLOBAL::main", result: 1 .function i64 test(i64[] a0, i32 a1) { diff --git a/static_core/tests/checked/loop-unroll-constant.pa b/static_core/tests/checked/loop-unroll-constant.pa index f7dda3d24..e6b14e283 100644 --- a/static_core/tests/checked/loop-unroll-constant.pa +++ b/static_core/tests/checked/loop-unroll-constant.pa @@ -68,6 +68,10 @@ #! INST /ReturnI.*0x0/ #! RUN options: "", entry: "_GLOBAL::main" +#! CHECKER LLVM AOT sanity check +#! RUN_LLVM options: "--compiler-regex=_GLOBAL::main2" +#! RUN options: "", entry: "_GLOBAL::main" + .language PandaAssembly .function u1 main() { diff --git a/static_core/tests/checked/memory-barrier.pa b/static_core/tests/checked/memory-barrier.pa index f0e8e762c..261833e51 100644 --- a/static_core/tests/checked/memory-barrier.pa +++ b/static_core/tests/checked/memory-barrier.pa @@ -13,7 +13,7 @@ #! CHECKER Constructor has memory barrier before return -#! RUN_PAOC options: "" +#! RUN_AOT options: "" #! METHOD "Test::_ctor" #! PASS_AFTER "IrBuilder" #! INST "ReturnVoid F" diff --git a/static_core/tests/checked/memory-coalescing.pa b/static_core/tests/checked/memory-coalescing.pa index 59200f16a..5349bd7df 100644 --- a/static_core/tests/checked/memory-coalescing.pa +++ b/static_core/tests/checked/memory-coalescing.pa @@ -29,6 +29,11 @@ #! INST_NOT "LoadObjectPair" #! RUN options: "", entry: "_GLOBAL::main", result: 0 +#! CHECKER LLVM AOT sanity check +#! SKIP_IF @architecture != "arm64" +#! RUN_LLVM options: "--compiler-inlining false" +#! RUN options: "", entry: "_GLOBAL::main", result: 0 + .record A { i32 a i32 b diff --git a/static_core/tests/checked/memory-coalescing1.pa b/static_core/tests/checked/memory-coalescing1.pa index 94dd6c115..c0d2bffed 100644 --- a/static_core/tests/checked/memory-coalescing1.pa +++ b/static_core/tests/checked/memory-coalescing1.pa @@ -32,6 +32,11 @@ #! INST "StoreObject" #! RUN options: "", entry: "_GLOBAL::main", result: 0 +#! CHECKER LLVM AOT sanity check +#! SKIP_IF @architecture != "arm64" +#! RUN_LLVM options: "--compiler-inlining false" +#! RUN options: "", entry: "_GLOBAL::main", result: 0 + .record A { i32 a i32 b diff --git a/static_core/tests/checked/memset_loop_idiom.pa b/static_core/tests/checked/memset_loop_idiom.pa index 2d4310fc2..b410d6054 100644 --- a/static_core/tests/checked/memset_loop_idiom.pa +++ b/static_core/tests/checked/memset_loop_idiom.pa @@ -28,6 +28,10 @@ #! INST "Intrinsic" #! ASM_METHOD "_GLOBAL::fill" #! ASM_INST "Intrinsic.LIB_CALL_MEMSET_8" + +#! CHECKER Sanity check for LLVM AOT +#! RUN_LLVM options: "--compiler-regex=_GLOBAL::fill" + .function void fill(i8[] a0, i8 a1) { movi v0, 0x0 loop: diff --git a/static_core/tests/checked/parameter_test.pa b/static_core/tests/checked/parameter_test.pa index 46accb5a5..b6caba8c8 100644 --- a/static_core/tests/checked/parameter_test.pa +++ b/static_core/tests/checked/parameter_test.pa @@ -23,11 +23,8 @@ #! EVENT /Compilation,.*foo_u64.*/ #! CHECKER Check method parameters Regular AOT -#! RUN_PAOC options: "--compiler-inlining=false" -#! RUN entry: "_GLOBAL::main" - -#! CHECKER Check method parameters LLVM AOT -#! RUN_LLVM options: "--compiler-inlining=false" +#! SKIP_IF @architecture == "arm32" +#! RUN_AOT options: "--compiler-inlining=false" #! RUN entry: "_GLOBAL::main" .function f32 foo_f32(f32 a0) { diff --git a/static_core/tests/checked/ref_check_elim_test.pa b/static_core/tests/checked/ref_check_elim_test.pa index ab8d91370..591b1dfa3 100644 --- a/static_core/tests/checked/ref_check_elim_test.pa +++ b/static_core/tests/checked/ref_check_elim_test.pa @@ -27,21 +27,8 @@ #! INST "NewArray" #! INST_NOT "RefTypeCheck" -#! CHECKER Removing RefTypeCheck for string arrays Regular AOT -#! RUN_PAOC options: "--compiler-regex='_GLOBAL::main'" -#! METHOD "_GLOBAL::main" -#! PASS_AFTER "IrBuilder" -#! INST "RefTypeCheck" -#! INST "LoadString" -#! INST "NewArray" -#! PASS_AFTER "ChecksElimination" -#! INST "LoadString" -#! INST "NewArray" -#! INST_NOT "RefTypeCheck" -#! RUN entry: "_GLOBAL::main" - -#! CHECKER Removing RefTypeCheck for string arrays LLVM AOT -#! RUN_LLVM options: "--compiler-regex='_GLOBAL::main'" +#! CHECKER Removing RefTypeCheck for string arrays in AOT +#! RUN_AOT options: "--compiler-regex='_GLOBAL::main'" #! METHOD "_GLOBAL::main" #! PASS_AFTER "IrBuilder" #! INST "RefTypeCheck" diff --git a/static_core/tests/checked/remove_redundant_checks.pa b/static_core/tests/checked/remove_redundant_checks.pa index f164cedc0..03e82e352 100644 --- a/static_core/tests/checked/remove_redundant_checks.pa +++ b/static_core/tests/checked/remove_redundant_checks.pa @@ -36,6 +36,11 @@ #! RUN options: "", entry: "_GLOBAL::main" #! EVENT "AotEntrypointFound,_GLOBAL::main" +#! CHECKER LLVM AOT sanity check +#! SKIP_IF @architecture == "arm32" +#! RUN_LLVM options: "" +#! RUN options: "", entry: "_GLOBAL::main" + .record Asm{ i32[] asm1 } diff --git a/static_core/tests/checked/scalar_replacement.pa b/static_core/tests/checked/scalar_replacement.pa index 8f9d303ac..c0ff88f98 100644 --- a/static_core/tests/checked/scalar_replacement.pa +++ b/static_core/tests/checked/scalar_replacement.pa @@ -28,6 +28,10 @@ #! INST_NOT "NewObject" #! RUN options: "", entry: "_GLOBAL::main", result: 42 +#! CHECKER Scalar replacement (LLVM AOT) +#! RUN_LLVM options: "--compiler-regex=_GLOBAL::main" +#! RUN options: "", entry: "_GLOBAL::main", result: 42 + .function i32 main() { newobj v0, Obj ldai 42 diff --git a/static_core/tests/checked/stack_overflow.pa b/static_core/tests/checked/stack_overflow.pa index f8a0d9087..d46394b25 100644 --- a/static_core/tests/checked/stack_overflow.pa +++ b/static_core/tests/checked/stack_overflow.pa @@ -16,11 +16,8 @@ #! EVENT /Compilation,_GLOBAL::__noinline__inc_recursive,.*,COMPILED/ #! CHECKER Stack overflow at Regular AOT -#! RUN_PAOC options: "--compiler-regex _GLOBAL::__noinline__inc_recursive" -#! RUN entry: "_GLOBAL::main" - -#! DISABLED_CHECKER Stack overflow at LLVM AOT -#! RUN_LLVM options: "--compiler-regex _GLOBAL::__noinline__inc_recursive" +#! SKIP_IF @architecture == "arm32" +#! RUN_AOT options: "--compiler-regex _GLOBAL::__noinline__inc_recursive" #! RUN entry: "_GLOBAL::main" .record panda.StackOverflowException @@ -58,12 +55,10 @@ catch_stackoverflow_begin: #! EVENT /Compilation,_GLOBAL::__noinline__inc_recursive,.*,COMPILED/ #! CHECKER Stack overflow unhandled at Regular AOT +#! SKIP_IF @architecture == "arm32" #! RUN_PAOC options: "--compiler-regex _GLOBAL::__noinline__inc_recursive" #! RUN entry: "_GLOBAL::main_no_catch", result: 1 - -#! DISABLED_CHECKER Stack overflow unhandled at LLVM AOT -#! RUN_LLVM options: "--compiler-regex _GLOBAL::__noinline__inc_recursive" -#! RUN entry: "_GLOBAL::main_no_catch", result: 1 +#! LLVM_IGNORE reason: 'LLVM folds recursion into infinite loop' .function i32 main_no_catch() { movi v0, 0 diff --git a/static_core/tests/checked/tlab_test.pa b/static_core/tests/checked/tlab_test.pa index e27104a6c..d185c3677 100644 --- a/static_core/tests/checked/tlab_test.pa +++ b/static_core/tests/checked/tlab_test.pa @@ -28,18 +28,7 @@ #! TRUE EVENT_COUNT(/SlowpathAlloc,.*/) <= 2 #! CHECKER Use TLAB for array and object in AOT -#! RUN_PAOC options: "--compiler-enable-tlab-events=true --compiler-regex=.*tlab.* --young-shared-space-size=0" -#! RUN options: "--compiler-enable-tlab-events=true", entry: "_GLOBAL::main" -#! TRUE EVENT_COUNT(/SlowpathAlloc,.*/) <= 2 -#! EVENT /TlabAlloc,.*,24/ -#! EVENT_NEXT /TlabAlloc,.*,32/ -#! EVENT_NEXT /TlabAlloc,.*,40/ -#! EVENT_NEXT /TlabAlloc,.*,56/ -#! EVENT_NEXT /TlabAlloc,.*,16/ -#! EVENT_NEXT /TlabAlloc,.*,24/ - -#! CHECKER Use TLAB for array and object in LLVMAOT -#! RUN_LLVM options: "--compiler-enable-tlab-events=true --compiler-regex=.*tlab.* --young-shared-space-size=0" +#! RUN_AOT options: "--compiler-enable-tlab-events=true --compiler-regex=.*tlab.* --young-shared-space-size=0" #! RUN options: "--compiler-enable-tlab-events=true", entry: "_GLOBAL::main" #! TRUE EVENT_COUNT(/SlowpathAlloc,.*/) <= 2 #! EVENT /TlabAlloc,.*,24/ @@ -61,13 +50,7 @@ #! EVENT_NOT /TlabAlloc,.*/ #! CHECKER Don't Use TLAB for array and object for STW in AOT -#! RUN_PAOC options: "--compiler-enable-tlab-events=true --gc-type=stw --compiler-regex=.*tlab.*" -#! RUN options: "--compiler-enable-tlab-events=true --gc-type=stw", entry: "_GLOBAL::main" -#! EVENT /SlowpathAlloc,.*/ -#! EVENT_NOT /TlabAlloc,.*/ - -#! CHECKER Don't Use TLAB for array and object for STW in LLVMAOT -#! RUN_LLVM options: "--compiler-enable-tlab-events=true --gc-type=stw --compiler-regex=.*tlab.*" +#! RUN_AOT options: "--compiler-enable-tlab-events=true --gc-type=stw --compiler-regex=.*tlab.*" #! RUN options: "--compiler-enable-tlab-events=true --gc-type=stw", entry: "_GLOBAL::main" #! EVENT /SlowpathAlloc,.*/ #! EVENT_NOT /TlabAlloc,.*/ diff --git a/static_core/tests/checked/verify_aot_tests/verify_aot_test.pa b/static_core/tests/checked/verify_aot_tests/verify_aot_test.pa index 972d31564..b5de79b33 100644 --- a/static_core/tests/checked/verify_aot_tests/verify_aot_test.pa +++ b/static_core/tests/checked/verify_aot_tests/verify_aot_test.pa @@ -87,3 +87,7 @@ #! RUN options: "--panda-files=../../verify_aot_tests_file1.checked/test.abc --aot-verify-abs-path=false", entry: "VerifyAotTest::main", abort: 6 #! EVENT /AotManager,.*test.*,ADDED/ #! EVENT /AotManager,.*test.*,CHA_VERIFY_FAILED/ + +#! CHECKER Sanity check in LLVM AOT +#! RUN_LLVM options: "" +#! RUN options: "", entry: "VerifyAotTest::main", result: 1 diff --git a/static_core/tests/checked/zero_const_in_save_state.pa b/static_core/tests/checked/zero_const_in_save_state.pa index 9702427b3..dcc162bd3 100644 --- a/static_core/tests/checked/zero_const_in_save_state.pa +++ b/static_core/tests/checked/zero_const_in_save_state.pa @@ -16,23 +16,15 @@ #! EVENT /Compilation,_GLOBAL::main0,.*COMPILED/ #! CHECKER Check that save state gracefully handle 0 when optimizations are disabled, test for 5372 at Regular AOT -#! RUN_PAOC options: "--compiler-non-optimizing=true" +#! RUN_AOT options: "--compiler-non-optimizing=true" #! RUN entry: "_GLOBAL::main0" -#! CHECKER Check that save state gracefully handle 0 when optimizations are disabled, test for 5372 at LLVM AOT -#! RUN_LLVM options: "--compiler-non-optimizing=true" -#! RUN entry: "_GLOBAL::main0" - -#! CHECKER Check that save state correctly propogated in presense of null ref, test for 5372 +#! CHECKER Check that save state correctly propagated in presence of null ref, test for 5372 #! RUN force_jit: true, options: "--compiler-lowering=false --gc-trigger-type=debug", entry: "_GLOBAL::main1" #! EVENT /Compilation,_GLOBAL::main1,.*COMPILED/ -#! CHECKER Check that save state correctly propogated in presense of null ref, test for 5372 at Regular AOT -#! RUN_PAOC options: "--compiler-non-optimizing=false" -#! RUN entry: "_GLOBAL::main0" - -#! CHECKER Check that save state correctly propogated in presense of null ref, test for 5372 at LLVM AOT -#! RUN_LLVM options: "--compiler-non-optimizing=false" +#! CHECKER Check that save state correctly propagated in presence of null ref, test for 5372 at Regular AOT +#! RUN_AOT options: "--compiler-non-optimizing=false" #! RUN entry: "_GLOBAL::main1" .record E {} -- Gitee From 96a2aa6c3f35847fd1170fdd59e8dff27ec60b1a Mon Sep 17 00:00:00 2001 From: Denis Zavedeev Date: Tue, 12 Nov 2024 13:07:18 +0300 Subject: [PATCH 4/6] Apply more attributes Signed-off-by: Denis Zavedeev --- .../lowering/llvm_ir_constructor.cpp | 16 ++++++++++ .../libllvmbackend/transforms/builtins.cpp | 29 +++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/static_core/libllvmbackend/lowering/llvm_ir_constructor.cpp b/static_core/libllvmbackend/lowering/llvm_ir_constructor.cpp index a1e322a11..314aed24f 100644 --- a/static_core/libllvmbackend/lowering/llvm_ir_constructor.cpp +++ b/static_core/libllvmbackend/lowering/llvm_ir_constructor.cpp @@ -1144,6 +1144,9 @@ bool LLVMIrConstructor::EmitStringGetCharsTlab(Inst *inst) result->setCallingConv(cc); result->addRetAttr(llvm::Attribute::NonNull); result->addRetAttr(llvm::Attribute::NoAlias); + result->addRetAttr(llvm::Attribute::NoUndef); + result->addRetAttr( + llvm::Attribute::get(func_->getContext(), llvm::Attribute::Alignment, DEFAULT_ALIGNMENT_IN_BYTES)); ValueMapAdd(inst, result); return true; } @@ -3223,10 +3226,18 @@ void LLVMIrConstructor::InitializeEntryBlock(bool noInline) func_->setLinkage(llvm::Function::WeakAnyLinkage); } + const auto aligned = + llvm::Attribute::get(func_->getContext(), llvm::Attribute::Alignment, DEFAULT_ALIGNMENT_IN_BYTES); if (GetGraph()->SupportManagedCode()) { + static_assert(alignof(ark::Method) == DEFAULT_ALIGNMENT_IN_BYTES); func_->addParamAttr(GetMethodArgument()->getArgNo(), llvm::Attribute::NonNull); + func_->addParamAttr(GetMethodArgument()->getArgNo(), aligned); if (!GetGraph()->GetRuntime()->IsMethodStatic(GetGraph()->GetMethod())) { func_->addParamAttr(GetArgument(0)->getArgNo(), llvm::Attribute::NonNull); + func_->addParamAttr(GetArgument(0)->getArgNo(), aligned); + } + for (size_t i = 0; i < func_->arg_size(); i++) { + func_->addParamAttr(i, llvm::Attribute::NoUndef); } } @@ -3248,6 +3259,8 @@ void LLVMIrConstructor::MarkAsAllocation(llvm::CallInst *call) call->addFnAttr(builder.getAttribute(llvm::Attribute::AllocKind)); call->addRetAttr(llvm::Attribute::NonNull); call->addRetAttr(llvm::Attribute::NoAlias); + call->addRetAttr(llvm::Attribute::NoUndef); + call->addRetAttr(llvm::Attribute::get(call->getContext(), llvm::Attribute::Alignment, DEFAULT_ALIGNMENT_IN_BYTES)); } // Instruction Visitors @@ -4750,6 +4763,9 @@ void LLVMIrConstructor::VisitIntrinsic(GraphVisitor *v, Inst *inst) ASSERT(inst->GetType() == DataType::REFERENCE); ASSERT(result->getType()->isPointerTy()); result->addRetAttr(llvm::Attribute::NonNull); + result->addRetAttr(llvm::Attribute::NoUndef); + result->addRetAttr(llvm::Attribute::get(ctor->func_->getContext(), llvm::Attribute::Alignment, + DEFAULT_ALIGNMENT_IN_BYTES)); } ctor->ValueMapAdd(inst, result); } diff --git a/static_core/libllvmbackend/transforms/builtins.cpp b/static_core/libllvmbackend/transforms/builtins.cpp index 3d6628806..a1cd65425 100644 --- a/static_core/libllvmbackend/transforms/builtins.cpp +++ b/static_core/libllvmbackend/transforms/builtins.cpp @@ -198,6 +198,9 @@ llvm::Function *LenArray(llvm::Module *module) function->setDoesNotThrow(); function->addFnAttr(llvm::Attribute::ReadNone); function->addFnAttr(llvm::Attribute::WillReturn); + function->addParamAttr(0U, llvm::Attribute::NonNull); + function->addParamAttr(0U, llvm::Attribute::NoUndef); + function->addRetAttr(llvm::Attribute::NoUndef); return function; } @@ -215,6 +218,8 @@ llvm::Function *KeepThis(llvm::Module *module) function->setSectionPrefix(BUILTIN_SECTION); function->setDoesNotThrow(); function->addFnAttr(llvm::Attribute::WillReturn); + function->addParamAttr(0U, llvm::Attribute::NonNull); + function->addParamAttr(0U, llvm::Attribute::NoUndef); return function; } @@ -246,6 +251,10 @@ llvm::Function *LoadClass(llvm::Module *module) function = llvm::Function::Create(type, llvm::Function::ExternalLinkage, LOAD_CLASS_BUILTIN, module); function->setSectionPrefix(BUILTIN_SECTION); function->setDoesNotThrow(); + function->addParamAttr(0U, llvm::Attribute::NoUndef); + function->addParamAttr(1U, llvm::Attribute::NoUndef); + function->addRetAttr(llvm::Attribute::NoUndef); + function->addRetAttr(llvm::Attribute::NonNull); return function; } @@ -262,6 +271,10 @@ llvm::Function *LoadInitClass(llvm::Module *module) function = llvm::Function::Create(type, llvm::Function::ExternalLinkage, LOAD_INIT_CLASS_BUILTIN, module); function->setSectionPrefix(BUILTIN_SECTION); function->setDoesNotThrow(); + function->addParamAttr(0, llvm::Attribute::NoUndef); + function->addParamAttr(1U, llvm::Attribute::NoUndef); + function->addRetAttr(llvm::Attribute::NoUndef); + function->addRetAttr(llvm::Attribute::NonNull); return function; } @@ -281,6 +294,9 @@ llvm::Function *PreWRB(llvm::Module *module, unsigned addrSpace) function->addFnAttr(llvm::Attribute::ArgMemOnly); function->addFnAttr(llvm::Attribute::WillReturn); function->addParamAttr(0U, llvm::Attribute::ReadOnly); + function->addParamAttr(0U, llvm::Attribute::NonNull); + function->addParamAttr(0U, llvm::Attribute::NoUndef); + function->addParamAttr(1U, llvm::Attribute::NoUndef); return function; } @@ -302,7 +318,11 @@ llvm::Function *PostWRB(llvm::Module *module, unsigned addrSpace) function->addFnAttr(llvm::Attribute::ArgMemOnly); function->addFnAttr(llvm::Attribute::WillReturn); function->addParamAttr(0U, llvm::Attribute::ReadNone); + function->addParamAttr(0U, llvm::Attribute::NoUndef); + function->addParamAttr(0U, llvm::Attribute::NonNull); + function->addParamAttr(1U, llvm::Attribute::NoUndef); function->addParamAttr(2U, llvm::Attribute::ReadNone); + function->addParamAttr(2U, llvm::Attribute::NoUndef); return function; } @@ -319,6 +339,9 @@ llvm::Function *LoadString(llvm::Module *module) function = llvm::Function::Create(type, llvm::Function::ExternalLinkage, LOAD_STRING_BUILTIN, module); function->setSectionPrefix(BUILTIN_SECTION); function->setDoesNotThrow(); + function->addParamAttr(0U, llvm::Attribute::NoUndef); + function->addParamAttr(1U, llvm::Attribute::NoUndef); + function->addRetAttr(llvm::Attribute::NoUndef); return function; } @@ -336,6 +359,12 @@ llvm::Function *ResolveVirtual(llvm::Module *module) function = llvm::Function::Create(type, llvm::Function::ExternalLinkage, RESOLVE_VIRTUAL_BUILTIN, module); function->setSectionPrefix(BUILTIN_SECTION); function->setDoesNotThrow(); + function->addParamAttr(0U, llvm::Attribute::NoUndef); + function->addParamAttr(0U, llvm::Attribute::NonNull); + function->addParamAttr(1U, llvm::Attribute::NoUndef); + function->addParamAttr(2U, llvm::Attribute::NoUndef); + function->addRetAttr(llvm::Attribute::NoUndef); + function->addRetAttr(llvm::Attribute::NonNull); return function; } -- Gitee From 9b04e487b2c96b13d80b0f33a7a94f36b59a9682 Mon Sep 17 00:00:00 2001 From: Denis Zavedeev Date: Tue, 19 Nov 2024 21:28:08 +0300 Subject: [PATCH 5/6] Refactor 'ExpandAtomics' Signed-off-by: Denis Zavedeev --- .../transforms/passes/expand_atomics.cpp | 28 ++++++++----------- .../transforms/passes/expand_atomics.h | 2 +- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/static_core/libllvmbackend/transforms/passes/expand_atomics.cpp b/static_core/libllvmbackend/transforms/passes/expand_atomics.cpp index f0b216e2c..0dfedc57a 100644 --- a/static_core/libllvmbackend/transforms/passes/expand_atomics.cpp +++ b/static_core/libllvmbackend/transforms/passes/expand_atomics.cpp @@ -51,37 +51,31 @@ llvm::PreservedAnalyses ExpandAtomics::run(llvm::Function &function, return changed ? llvm::PreservedAnalyses::none() : llvm::PreservedAnalyses::all(); } -bool ExpandAtomics::InsertAddrSpaceCast(llvm::Instruction *atomicInstruction) +bool ExpandAtomics::InsertAddrSpaceCast(llvm::Instruction *inst) { - ASSERT(atomicInstruction->isAtomic()); - if (llvm::isa(atomicInstruction)) { + ASSERT(inst->isAtomic()); + if (llvm::isa(inst)) { // Fences do not have pointer operands return false; } unsigned pointerIndex = 0; - if (llvm::isa(atomicInstruction)) { + if (llvm::isa(inst)) { pointerIndex = 1U; } - auto pointer = atomicInstruction->getOperand(pointerIndex); + auto pointer = inst->getOperand(pointerIndex); ASSERT(pointer->getType()->isPointerTy()); if (pointer->getType()->getPointerAddressSpace() != LLVMArkInterface::GC_ADDR_SPACE) { return false; } - LLVM_DEBUG(llvm::dbgs() << "Inserting addrspacecast for '"); - LLVM_DEBUG(atomicInstruction->print(llvm::dbgs())); - LLVM_DEBUG(llvm::dbgs() << "'\n"); + LLVM_DEBUG(llvm::dbgs() << "Inserting addrspacecast for '" << *inst << "\n"); - auto cast = llvm::CastInst::Create(llvm::CastInst::AddrSpaceCast, pointer, - llvm::PointerType::get(atomicInstruction->getContext(), 0)); - cast->insertBefore(atomicInstruction); - atomicInstruction->setOperand(pointerIndex, cast); + auto cast = + llvm::CastInst::Create(llvm::CastInst::AddrSpaceCast, pointer, llvm::PointerType::get(inst->getContext(), 0)); + cast->insertBefore(inst); + inst->setOperand(pointerIndex, cast); - LLVM_DEBUG(llvm::dbgs() << "Result: cast = '"); - LLVM_DEBUG(cast->print(llvm::dbgs())); - LLVM_DEBUG(llvm::dbgs() << "', atomic_instruction = '"); - LLVM_DEBUG(atomicInstruction->print(llvm::dbgs())); - LLVM_DEBUG(llvm::dbgs() << "'\n"); + LLVM_DEBUG(llvm::dbgs() << "Result: cast = '" << *cast << "', inst = '" << *inst << "\n"); return true; } diff --git a/static_core/libllvmbackend/transforms/passes/expand_atomics.h b/static_core/libllvmbackend/transforms/passes/expand_atomics.h index 92c27c71d..5f055e6dc 100644 --- a/static_core/libllvmbackend/transforms/passes/expand_atomics.h +++ b/static_core/libllvmbackend/transforms/passes/expand_atomics.h @@ -39,7 +39,7 @@ public: llvm::PreservedAnalyses run(llvm::Function &function, llvm::FunctionAnalysisManager &analysisManager); private: - bool InsertAddrSpaceCast(llvm::Instruction *atomicInstruction); + bool InsertAddrSpaceCast(llvm::Instruction *inst); }; } // namespace ark::llvmbackend::passes -- Gitee From f1710f54a3cf1f361e697d2dd3024463cd33a9b5 Mon Sep 17 00:00:00 2001 From: Roman Zhuykov Date: Thu, 28 Nov 2024 12:34:31 +0300 Subject: [PATCH 6/6] Add RUN_AOT into new test --- .../ets/tests/checked/string_tlab_allocations.sts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/static_core/plugins/ets/tests/checked/string_tlab_allocations.sts b/static_core/plugins/ets/tests/checked/string_tlab_allocations.sts index 7d9bef3f9..eb6a38d57 100644 --- a/static_core/plugins/ets/tests/checked/string_tlab_allocations.sts +++ b/static_core/plugins/ets/tests/checked/string_tlab_allocations.sts @@ -19,7 +19,7 @@ //! EVENT_NEXT /TlabAlloc,.*,48/ //! CHECKER Use TLAB for string from chars allocations AOT -//! RUN_PAOC options: "--compiler-enable-tlab-events=true --compiler-regex=.*CreateStringFromChars.*" +//! RUN_AOT options: "--compiler-enable-tlab-events=true --compiler-regex=.*CreateStringFromChars.*" //! RUN options: "--compiler-enable-tlab-events=true", env: "LD_LIBRARY_PATH=../../../../../../lib", entry: "ETSGLOBAL::testCreateStringFromChars" //! EVENT /TlabAlloc,.*,40/ //! EVENT_NEXT /TlabAlloc,.*,48/ @@ -30,7 +30,7 @@ //! EVENT_NEXT /TlabAlloc,.*,48/ //! CHECKER Use TLAB for string from string allocations AOT -//! RUN_PAOC options: "--compiler-enable-tlab-events=true --compiler-regex=.*CreateStringFromString.*" +//! RUN_AOT options: "--compiler-enable-tlab-events=true --compiler-regex=.*CreateStringFromString.*" //! RUN options: "--compiler-enable-tlab-events=true", env: "LD_LIBRARY_PATH=../../../../../../lib", entry: "ETSGLOBAL::testCreateStringFromString" //! EVENT /TlabAlloc,.*,40/ //! EVENT_NEXT /TlabAlloc,.*,48/ @@ -41,7 +41,7 @@ //! EVENT_NEXT /TlabAlloc,.*,48/ //! CHECKER Use TLAB for String.getChars() allocations AOT -//! RUN_PAOC options: "--compiler-enable-tlab-events=true --compiler-regex=.*GetCharsFromString.*" +//! RUN_AOT options: "--compiler-enable-tlab-events=true --compiler-regex=.*GetCharsFromString.*" //! RUN options: "--compiler-enable-tlab-events=true", env: "LD_LIBRARY_PATH=../../../../../../lib", entry: "ETSGLOBAL::testGetCharsFromString" //! EVENT /TlabAlloc,.*,64/ //! EVENT_NEXT /TlabAlloc,.*,48/ @@ -52,7 +52,7 @@ //! EVENT_NEXT /TlabAlloc,.*,32/ //! CHECKER Use TLAB for String.getBytes() allocations AOT -//! RUN_PAOC options: "--compiler-enable-tlab-events=true --compiler-regex=.*GetBytesFromString.*" +//! RUN_AOT options: "--compiler-enable-tlab-events=true --compiler-regex=.*GetBytesFromString.*" //! RUN options: "--compiler-enable-tlab-events=true", env: "LD_LIBRARY_PATH=../../../../../../lib", entry: "ETSGLOBAL::testGetBytesFromString" //! EVENT /TlabAlloc,.*,40/ //! EVENT_NEXT /TlabAlloc,.*,32/ @@ -64,7 +64,7 @@ //! EVENT_NEXT /TlabAlloc,.*,56/ //! CHECKER Use TLAB for String.substring() allocations AOT -//! RUN_PAOC options: "--compiler-enable-tlab-events=true --compiler-regex=.*StringSubstring.*" +//! RUN_AOT options: "--compiler-enable-tlab-events=true --compiler-regex=.*StringSubstring.*" //! RUN options: "--compiler-enable-tlab-events=true", env: "LD_LIBRARY_PATH=../../../../../../lib", entry: "ETSGLOBAL::testStringSubstring" //! EVENT /TlabAlloc,.*,32/ //! EVENT_NEXT /TlabAlloc,.*,40/ @@ -87,10 +87,9 @@ //! EVENT_NEXT /TlabAlloc,.*,48/ //! CHECKER Use TLAB for StringBuilder.append() allocations AOT -//! RUN_PAOC options: "--compiler-enable-tlab-events=true --compiler-regex=.*StringBuilderAppend.*" +//! RUN_AOT options: "--compiler-enable-tlab-events=true --compiler-regex=.*StringBuilderAppend.*" //! RUN options: "--compiler-enable-tlab-events=true", env: "LD_LIBRARY_PATH=../../../../../../lib", entry: "ETSGLOBAL::testStringBuilderAppend" //! EVENT /TlabAlloc,.*,24/ -//! EVENT_NEXT /TlabAlloc,.*,32/ //! EVENT_NEXT /TlabAlloc,.*,48/ //! EVENT_NEXT /TlabAlloc,.*,24/ //! EVENT_NEXT /TlabAlloc,.*,48/ -- Gitee