diff --git a/README.md b/README.md index 65aabbc94a131d3bc99cff04058b91c461d19779..492f599696e7ff4e95bdbd0d8c079031722c3eed 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ As a common module of ARK runtime, Runtime Core consists of some basic language-irrelevant runtime libraries, including ARK File, Tooling, and ARK Base. ARK File provides bytecodes and information required for executing bytecodes. Tooling supports Debugger. ARK Base is responsible for implementing platform related utilities. -For more infomation, see: [ARK Runtime Subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/ARK-Runtime-Subsystem.md). +For more information, see: [ARK Runtime Subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/ARK-Runtime-Subsystem.md). ## Directory Structure @@ -141,7 +141,7 @@ Input file: ARK bytecodes in binary format Output file: ARK bytecodes in text format -For more infomation, please see: [ARK Runtime Usage Guide](https://gitee.com/openharmony/ark_js_runtime/blob/master/docs/ARK-Runtime-Usage-Guide.md). +For more information, please see: [ARK Runtime Usage Guide](https://gitee.com/openharmony/ark_js_runtime/blob/master/docs/ARK-Runtime-Usage-Guide.md). ## Repositories Involved diff --git a/assembler/meta.cpp b/assembler/meta.cpp index eec52ef8686dc7965b1936ae9231de0c975701b3..361052f6ca4f7fd3295fd623c08ca6b2ba2c363a 100644 --- a/assembler/meta.cpp +++ b/assembler/meta.cpp @@ -29,7 +29,7 @@ std::optional Metadata::ValidateSize(std::string_view value) co constexpr size_t SIZE = 10; if (!std::all_of(value.cbegin(), value.cend(), ::isdigit)) { - return Error("Unsigned interger value expected", Error::Type::INVALID_VALUE); + return Error("Unsigned integer value expected", Error::Type::INVALID_VALUE); } strtoul(value.data(), nullptr, SIZE); diff --git a/cmake/ClangTidy.cmake b/cmake/ClangTidy.cmake index 7a1189a3940769ea9efc69649af05040ed6bb291..67730256ea9c1cac93b8c5f67f77cf3db0ba655f 100644 --- a/cmake/ClangTidy.cmake +++ b/cmake/ClangTidy.cmake @@ -134,7 +134,7 @@ function(panda_add_to_clang_tidy) "-hicpp-member-init" # alias for cppcoreguidelines-pro-type-member-init "-hicpp-move-const-arg" # alias for performance-move-const-arg # explicitly disabled checks - "-bugprone-macro-parentheses" # disabled because it is hard to write macroses with types with it + "-bugprone-macro-parentheses" # disabled because it is hard to write macros with types with it "-llvm-header-guard" # disabled because of incorrect root prefix "-llvm-include-order" # disabled because conflicts with the clang-format "-readability-identifier-naming" # disabled because we will use little-hump-style diff --git a/cmake/Definitions.cmake b/cmake/Definitions.cmake index 3aabf2b26f8f90abc60032ef75ac40db35cf1595..68a91fbd61fff47ccbe70c733b62fb87422ed67e 100644 --- a/cmake/Definitions.cmake +++ b/cmake/Definitions.cmake @@ -86,13 +86,13 @@ endif() # Clang 8.0.0 doesn't support all necessary options -ffixed-. Gcc 7.5.0 freezes # when compiling release interpreter. # -# Also calling conventions of funtions that use global register variables are different: +# Also calling conventions of functions that use global register variables are different: # clang stores and restores registers that are used for global variables in the prolog # and epilog of such functions and gcc doesn't do it. So it's necessary to inline all # function that refers to global register variables to interpreter loop. # For this reason we disable global register variables usage for clang debug builds as -# ALWAYS_INLINE macro expands to nothing in this mode and we cannot garantee that all +# ALWAYS_INLINE macro expands to nothing in this mode and we cannot guarantee that all # necessary function will be inlined. # if(PANDA_TARGET_ARM64 AND ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang" diff --git a/cmake/PandaCmakeFunctions.cmake b/cmake/PandaCmakeFunctions.cmake index 2c0eaed66a64cbc44ad184b689bebdf681447275..ce6e6e884fbc1bbe05b4b232d7879074557307cb 100644 --- a/cmake/PandaCmakeFunctions.cmake +++ b/cmake/PandaCmakeFunctions.cmake @@ -13,7 +13,7 @@ # 32-bits pointers optimization in Panda for objects => addresses usage low 4GB # We need use linker scripts for section replacement above 4GB -# Note: AdressSanitizer reserves (mmap) addresses for its own needs, +# Note: AddressSanitizer reserves (mmap) addresses for its own needs, # so we have difference start addresses for asan and default buildings function(panda_add_executable target) # When using rapidcheck we should use linker scripts with @@ -38,7 +38,7 @@ function(panda_add_executable target) endif() endif() # We need use specific options for AMD64 building with Clang compiler - # because it is neccessary for placement of sections above 4GB + # because it is necessary for placement of sections above 4GB if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND PANDA_TARGET_AMD64) set(LINKER_SCRIPT_ARG "${LINKER_SCRIPT_ARG} -pie") # -mcmodel=large with clang and asan on x64 leads to bugs in rapidcheck with high-mem mappings @@ -53,7 +53,7 @@ function(panda_add_executable target) endfunction() # This function need for non-SHARED libraries -# It is neccessary for 32-bits pointers via amd64 building with Clang compiler +# It is necessary for 32-bits pointers via amd64 building with Clang compiler function(panda_set_lib_32bit_property target) if(PANDA_USE_32_BIT_POINTER AND PANDA_TARGET_AMD64 AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set_property(TARGET ${target} PROPERTY POSITION_INDEPENDENT_CODE ON) diff --git a/docs/assembly_format.md b/docs/assembly_format.md index 9b1f3a2d3204e76c2630bb14e4f2a3934ba2a253..eade511ed9ad2a44abc521c9f8bed331bd3b788b 100644 --- a/docs/assembly_format.md +++ b/docs/assembly_format.md @@ -10,7 +10,7 @@ Panda as a platform is multilingual and flexible by design: * Panda Assembly should not "favor" by any means any existing programming language that is (or intended to be) supported by the platform. Instead, Panda Assembly can be thought as a separate close-to-byte-code language with a minimal feature set. All language-specific "traits" that should be supported to generate valid executable binaries with respect to the higher-level semantics should be implemented via metadata annotations (see below). * Panda Assembly should not focus on a certain programming paradigm. For example, concepts such as "class", "object", and "method" should not be enforced at the assembly language level because a language that does not implement classic OOP might be supported. -* When Panda assembler generates a binary excutable file, it is not expected to check for language semantics. This responsibility is delegated to "source to binaries" compilers and runtime. +* When Panda assembler generates a binary executable file, it is not expected to check for language semantics. This responsibility is delegated to "source to binaries" compilers and runtime. * Panda assembler should not impose any limitations on the quantity and internal structure of source code files written in Panda Assembly language. It should process as many input source code files as the developer specifies. * Panda assembler should not follow any implicit conventions about the name of the entry point. @@ -356,7 +356,7 @@ more precise verification of control flows in bytecode verifier. ``` They are identical to .catch and .catchall except that the end label of the -exception handler needs to be specified. An end label is the label that immediatly follows the last instruction of the +exception handler needs to be specified. An end label is the label that immediately follows the last instruction of the exception handler. ## Pseudo-BNF @@ -364,8 +364,8 @@ exception handler. Instruction flow is omitted for simplicity: ``` -# Literals are represnted in double-quotes as "literal value". -# Free-form descriptions are represneted as "" +# Literals are represented in double-quotes as "literal value". +# Free-form descriptions are represented as "" # Empty symbol is represented as E. defs := defs def | E diff --git a/docs/bc_verification/absint_checks.md b/docs/bc_verification/absint_checks.md index 730fdf95cdd277e0113d0643400d1a90205d8e15..3cf24b8e714ad265734265800ca47b04c158034a 100644 --- a/docs/bc_verification/absint_checks.md +++ b/docs/bc_verification/absint_checks.md @@ -16,7 +16,7 @@ Or access to wrong fields of object. ### Checks of subtyping -This type of checks ensure compatibily of objects in arguments to instructions and actual parameters to methos. +This type of checks ensure compatibility of objects in arguments to instructions and actual parameters to methods. The checks eliminate calls of methods with incorrect this, wrong access to arrays, etc. diff --git a/docs/design-of-interpreter.md b/docs/design-of-interpreter.md index ebfbb8a3e9de6d5376702e8503c327190b8f9fdf..4e562c0245d2b03674ef4310c8bb701bc29992e0 100644 --- a/docs/design-of-interpreter.md +++ b/docs/design-of-interpreter.md @@ -166,7 +166,7 @@ Please find the reference implementation [here](../runtime/interpreter). 1. Although tagged virtual registers occupy more memory (especially on 64-bit architectures), redundant memory consumption is cheaper than ongoing runtime penalties on garbage collector - trying to distiguish between objects from non-objects on an "imprecise" stack. + trying to distinguish between objects from non-objects on an "imprecise" stack. 1. Where does 128 come from? It is `128 = 64 + 64`. The first 64 is either `sizeof(long int)` or `sizeof(double)` or `sizeof(void *)` on a 64-bit architecture (i.e. theoretical maximum size of the payload we are required to store in a virtual register). The second 64 is for tag diff --git a/docs/file_format.md b/docs/file_format.md index 6c78770d45dcff037819968f1c615b82161fc275..f7a994a061b10f52af3bd555b5a81845e8403677 100644 --- a/docs/file_format.md +++ b/docs/file_format.md @@ -21,7 +21,7 @@ for addressing fields, methods, classes, etc. The format uses [TaggedValue](#taggedvalue), which stores only information we have, avoiding 0 offsets for absent information and saving more space. -However, to achive more compactness, 16-bit indexes are used to refer classes, methods and fields in +However, to achieve more compactness, 16-bit indexes are used to refer classes, methods and fields in the bytecode and some metadata. The file can contain multiple indexes, each one which covers part of the file and is described by [RegionHeader](#regionheader). @@ -64,7 +64,7 @@ structures should be located relatively to each other. The binary file format supports future changes via version number. The version field in the header is 4 bytes long and is encoded as a byte array to -avoid misinterpretation on platforms with different endianess. +avoid misinterpretation on platforms with different endianness. Any tool which supports format version `N` must support format version `N - 1` too. @@ -239,7 +239,7 @@ Constraint: Size of header must be > 16 bytes. [FieldType](#fieldType) uses this ### RegionHeader -To address file structures using 16-bit indexes file is splitted into regions. Each region has class, method, field and proto indexes and is described by `RegionHeader` structure. +To address file structures using 16-bit indexes file is split into regions. Each region has class, method, field and proto indexes and is described by `RegionHeader` structure. Alignment: 4 bytes diff --git a/docs/rationale-for-bytecode.md b/docs/rationale-for-bytecode.md index 99722f83bae351cc2813215bf9289ae309323bad..e06b800429a274fb3b1eb6785c800a7383ef5a72 100644 --- a/docs/rationale-for-bytecode.md +++ b/docs/rationale-for-bytecode.md @@ -165,8 +165,8 @@ instruction lacks a wide-range form, we can prepare operands for it with moves t needed forms. In this way, we save opcode space without compromising encoding size (on average). With such approach, we can carefully introduce various "overloads" for instruction when it could -be beneficial. For example, we have three types of instructions for integer-sized arithmetics -(acc-reg-reg, acc-reg, acc-imm) and integer-based jumps, but not for floating-point arithmetics +be beneficial. For example, we have three types of instructions for integer-sized arithmetic +(acc-reg-reg, acc-reg, acc-imm) and integer-based jumps, but not for floating-point arithmetic (which is rare) and which is supposed to have only acc-reg form. Another good choice for overloads are calls (different number of operands) and calls are the most popular instructions in applications (thus we again save encoding space). diff --git a/dprof/daemon/main.cpp b/dprof/daemon/main.cpp index ab101afecae7c2990940c34ef19efd88da4101eb..e0d0d301cb86edab042af7be84cf2e072e2e269b 100644 --- a/dprof/daemon/main.cpp +++ b/dprof/daemon/main.cpp @@ -216,7 +216,7 @@ static void SetupSignals() }; PLOG_IF(::memset_s(&sa, sizeof(sa), 0, sizeof(sa)) != EOK, FATAL, DPROF) << "memset_s failed"; sa.sa_handler = SignalHandler; // NOLINT(cppcoreguidelines-pro-type-union-access) - PLOG_IF(::sigemptyset(&sa.sa_mask) == -1, FATAL, DPROF) << "sigemptyset() faild"; + PLOG_IF(::sigemptyset(&sa.sa_mask) == -1, FATAL, DPROF) << "sigemptyset() failed"; PLOG_IF(::sigaction(SIGINT, &sa, nullptr) == -1, FATAL, DPROF) << "sigaction(SIGINT) failed"; PLOG_IF(::sigaction(SIGHUP, &sa, nullptr) == -1, FATAL, DPROF) << "sigaction(SIGHUP) failed"; diff --git a/libpandabase/README.md b/libpandabase/README.md index e7965988884088a047afbb315d2c59b803e425b0..7a61d72fb24202f004377971d236c8a24ea07ab1 100644 --- a/libpandabase/README.md +++ b/libpandabase/README.md @@ -37,7 +37,7 @@ Constructor can accept: There is description for them: - Argument name, is a name, which will appear in a command line. - Default value is a value argument will have regardless was it parsed or not. -- Argument description will be used to form a help messsage. +- Argument description will be used to form a help message. - Delimiter is a character or string that separates the different value if the single argument list. - Min value is the number that the integer argument cannot be less than. - Max value is the number that the integer argument cannot be greater than. diff --git a/libpandabase/os/native_stack.cpp b/libpandabase/os/native_stack.cpp index 8e49103306906b6cafa8f785814e214f692e558e..21db883579a776d685097fdc97e8ddae7b768b57 100644 --- a/libpandabase/os/native_stack.cpp +++ b/libpandabase/os/native_stack.cpp @@ -50,7 +50,7 @@ bool WriterOsFile([[maybe_unused]] const void *buffer, [[maybe_unused]] size_t c std::string ChangeJaveStackFormat([[maybe_unused]] const char *descriptor) { - return "unknow"; + return "unknown"; } #endif // PANDA_TARGET_UNIX diff --git a/libpandabase/utils/logger.h b/libpandabase/utils/logger.h index d22baae45c4d52b1d883d706151d400c44e6a7ed..c32991cf500f7f5f9acd0278042292a37dbe22f9 100644 --- a/libpandabase/utils/logger.h +++ b/libpandabase/utils/logger.h @@ -404,7 +404,7 @@ private: MERGE_WORDS(log_once_helper, __LINE__).IsFirstCall() && LOG(level, component) // Explicit namespace is specified to allow using the logger out of panda namespace. -// For exmaple, in the main function. +// For example, in the main function. // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define _LOG(level, component, p) \ panda::Logger::IsLoggingOnOrAbort(panda::Logger::Level::level, panda::Logger::Component::component) && \ diff --git a/runtime/bridge/arch/aarch64/interpreter_to_compiled_code_bridge_aarch64.S b/runtime/bridge/arch/aarch64/interpreter_to_compiled_code_bridge_aarch64.S index da6298daabaf507101255acdcac3a54ddaa46433..7b017a8dd1895ccbe65586345090686afa94d53a 100644 --- a/runtime/bridge/arch/aarch64/interpreter_to_compiled_code_bridge_aarch64.S +++ b/runtime/bridge/arch/aarch64/interpreter_to_compiled_code_bridge_aarch64.S @@ -37,7 +37,7 @@ // The macro works with the stack prepared by 'PrepareArgStack' procedure // It takes a pair (argument, type tag) and stores to the corresponding stack space // depends on its type. -// After the arg gets storeg the macro advances the correponding pointer +// After the arg gets storeg the macro advances the corresponding pointer // The macro assumes x9 contains base address for gpr and fpr args .macro PUSH_ARG arg_reg, tag_reg, gpr_ptr, fpr_ptr, stack_ptr, tmp_reg, next_label sub w2, w2, #SHORTY_FIRST_FLOAT diff --git a/runtime/bridge/arch/amd64/interpreter_to_compiled_code_bridge_amd64.S b/runtime/bridge/arch/amd64/interpreter_to_compiled_code_bridge_amd64.S index 0090d82e866549f3cf405fec29f059e2b0abce7d..6bf7c12ceac2ae3511e4bc26c787f82e899f75b0 100644 --- a/runtime/bridge/arch/amd64/interpreter_to_compiled_code_bridge_amd64.S +++ b/runtime/bridge/arch/amd64/interpreter_to_compiled_code_bridge_amd64.S @@ -99,7 +99,7 @@ // The macro works with the stack prepared by 'PrepareArgStack' macro // It takes an argument in arg_reg and stores it to the corresponding stack space // depends on its type. -// After the arg gets stored the macro advances the correponding pointer +// After the arg gets stored the macro advances the corresponding pointer // The macro assumes %r8 contains base address for gpr and fpr args .macro PUSH_ARG arg_reg, tag_reg, gpr_ptr, fpr_ptr, stack_ptr, tmp_reg, next_label subl $SHORTY_FIRST_FLOAT, %r11d diff --git a/runtime/bridge/arch/arm/interpreter_to_compiled_code_bridge_armhf.S b/runtime/bridge/arch/arm/interpreter_to_compiled_code_bridge_armhf.S index 1d46a19782f70f0124404db774bd58e249d9d8b8..64458cd723eb10a5e47884e54a650ae3d1a65ec1 100644 --- a/runtime/bridge/arch/arm/interpreter_to_compiled_code_bridge_armhf.S +++ b/runtime/bridge/arch/arm/interpreter_to_compiled_code_bridge_armhf.S @@ -67,7 +67,7 @@ // The macro works with the stack prepared by 'PrepareArgStack' procedure // It takes an argument in arg_reg and stores it to the corresponding stack space // depends on its type. -// After the arg gets storeg the macro advances the correponding pointer +// After the arg gets storeg the macro advances the corresponding pointer // The macro assumes x9 contains base address for gpr and fpr args .macro PUSH_ARG arg_ptr, gpr_ptr, fpr_ptr, stack_ptr, tmp1, tmp2, next_label diff --git a/runtime/include/class_linker.h b/runtime/include/class_linker.h index 3233f9907209e5e439435f289e1d996edf01f3f2..c740c85068661de7956b7b7c6ee77f570a7c4dd4 100644 --- a/runtime/include/class_linker.h +++ b/runtime/include/class_linker.h @@ -170,7 +170,7 @@ public: if (founded) { os << "|Parent class loader: #" << parent_index << "\n"; } else { - os << "|Parent class loader: unknow\n"; + os << "|Parent class loader: unknown\n"; } } else { os << "|Parent class loader: empty\n"; diff --git a/runtime/include/managed_thread.h b/runtime/include/managed_thread.h index 1f547bcfd6b5d784a132befad13dc8e1fe47ed8e..9d11709d9053f399f00e05ce9e15f6a569769694 100644 --- a/runtime/include/managed_thread.h +++ b/runtime/include/managed_thread.h @@ -365,7 +365,7 @@ public: // NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access) if (stor_32_.fts_.as_atomic.compare_exchange_weak(old_fts.as_nonvolatile_int, new_fts.as_nonvolatile_int, std::memory_order_release)) { - // If CAS succeeded, we set new status and no request occured here, safe to proceed. + // If CAS succeeded, we set new status and no request occurred here, safe to proceed. break; } } diff --git a/runtime/include/mtmanaged_thread.h b/runtime/include/mtmanaged_thread.h index 2a7dc91b26ad602b532394c44cda2d4b50ccef63..25930ae58baf7865878daff9043482b97a7a2f3c 100644 --- a/runtime/include/mtmanaged_thread.h +++ b/runtime/include/mtmanaged_thread.h @@ -470,7 +470,7 @@ private: if (no_flags && stor_32_.fts_.as_atomic.compare_exchange_weak( // NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access) old_fts.as_nonvolatile_int, new_fts.as_nonvolatile_int, std::memory_order_release)) { - // If CAS succeeded, we set new status and no request occured here, safe to proceed. + // If CAS succeeded, we set new status and no request occurred here, safe to proceed. break; } // clang-format on diff --git a/runtime/include/tooling/debug_interface.h b/runtime/include/tooling/debug_interface.h index a1bd76dee1b7e15793ddbdf5b32e94a72e768abf..1ca66df55dc6be9805199e4ed8a2e85c32023782 100644 --- a/runtime/include/tooling/debug_interface.h +++ b/runtime/include/tooling/debug_interface.h @@ -138,7 +138,7 @@ using ExceptionWrapper = std::string; // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) struct ThreadInfo { char *name; - size_t name_lenght; + size_t name_length; int32_t priority; bool is_daemon; threadGroup thread_group; diff --git a/runtime/mem/gc/gc.h b/runtime/mem/gc/gc.h index 2380767069caa172d490703d0fe5df5c2ca4eda4..1d047b64ce2dcf60a168911196362fed7b01cfbe 100644 --- a/runtime/mem/gc/gc.h +++ b/runtime/mem/gc/gc.h @@ -252,7 +252,7 @@ public: ObjectStatus MarkChecker(const ObjectHeader *object) const { if constexpr (!reversed_mark) { // NOLINTNEXTLINE(readability-braces-around-statements) - // If ClassAddr is not setted - it means object header initialization is in progress now + // If ClassAddr is not set - it means object header initialization is in progress now if (object->AtomicClassAddr() == nullptr) { return ObjectStatus::ALIVE_OBJECT; } diff --git a/runtime/mem/region_space.h b/runtime/mem/region_space.h index 0df56e40395832c8967983452705a30debd7269b..db3ccf30d7d614c784156b755b4dbe9b9a806185 100644 --- a/runtime/mem/region_space.h +++ b/runtime/mem/region_space.h @@ -193,7 +193,7 @@ public: template static Region *AddrToRegion(const void *addr, size_t mask = DEFAULT_REGION_MASK) { - // if it is possible that (object adress - region start addr) larger than region alignment, + // if it is possible that (object address - region start addr) larger than region alignment, // we should get the region start address from mmappool which records it in allocator info if constexpr (cross_region) { // NOLINTNEXTLINE(readability-braces-around-statements) auto region_addr = PoolManager::GetMmapMemPool()->GetStartAddrPoolForAddr(const_cast(addr)); diff --git a/runtime/options.yaml b/runtime/options.yaml index 7625641802849daccfc2a8d4d29653dd53c44afa..e660f8536a2a0d9209a6c332e103a0f1ddb6cbf1 100644 --- a/runtime/options.yaml +++ b/runtime/options.yaml @@ -421,7 +421,7 @@ options: - name: profilesaver-delta-number-threshold type: uint64_t default: 0 - description: delta number threashold of newly added method or class for profile saver + description: delta number threshold of newly added method or class for profile saver - name: profilesaver-enabled type: bool diff --git a/runtime/tests/string_test.cpp b/runtime/tests/string_test.cpp index 150e45e4c4ba54b312fc4969f4dab45a377e2bd6..0720bad310f3ef7197cf371fc70ca08062b03e1b 100644 --- a/runtime/tests/string_test.cpp +++ b/runtime/tests/string_test.cpp @@ -268,7 +268,7 @@ TEST_F(StringTest, DifferentLengthStringCompareTest) ASSERT_EQ(String::StringsAreEqual(first_string, second_string), false); } -TEST_F(StringTest, ForeignLenghtAndCopyTest1b0) +TEST_F(StringTest, ForeignLengthAndCopyTest1b0) { std::vector data {'a', 'b', 'c', 'd', 'z', 0xc0, 0x80, 0x00}; uint32_t utf16_length = data.size(); @@ -285,7 +285,7 @@ TEST_F(StringTest, ForeignLenghtAndCopyTest1b0) ASSERT_EQ(out16, res16); } -TEST_F(StringTest, ForeignLenghtAndCopyTest1b) +TEST_F(StringTest, ForeignLengthAndCopyTest1b) { std::vector data {'a', 'b', 'c', 'd', 'z', 0x7f, 0x00}; uint32_t utf16_length = data.size(); @@ -302,7 +302,7 @@ TEST_F(StringTest, ForeignLenghtAndCopyTest1b) ASSERT_EQ(out16, res16); } -TEST_F(StringTest, ForeignLenghtAndCopyTest2b) +TEST_F(StringTest, ForeignLengthAndCopyTest2b) { std::vector data {0xc2, 0xa7, 0x33, 0x00}; // UTF-16 size is 2 String *string = String::CreateFromMUtf8(data.data(), 2, GetLanguageContext(), Runtime::GetCurrent()->GetPandaVM()); @@ -317,7 +317,7 @@ TEST_F(StringTest, ForeignLenghtAndCopyTest2b) ASSERT_EQ(out16, res16); } -TEST_F(StringTest, ForeignLenghtAndCopyTest3b) +TEST_F(StringTest, ForeignLengthAndCopyTest3b) { std::vector data {0xef, 0xbf, 0x83, 0x33, 0x00}; // UTF-16 size is 2 String *string = String::CreateFromMUtf8(data.data(), 2, GetLanguageContext(), Runtime::GetCurrent()->GetPandaVM()); @@ -332,7 +332,7 @@ TEST_F(StringTest, ForeignLenghtAndCopyTest3b) ASSERT_EQ(out16, res16); } -TEST_F(StringTest, ForeignLenghtAndCopyTest6b) +TEST_F(StringTest, ForeignLengthAndCopyTest6b) { std::vector data {0xed, 0xa0, 0x81, 0xed, 0xb0, 0xb7, 0x20, 0x00}; // UTF-16 size is 3 // We support 4-byte utf-8 sequences, so {0xd801, 0xdc37} is encoded to 4 bytes instead of 6 @@ -580,7 +580,7 @@ TEST_F(StringTest, CompareTest) ASSERT_EQ(string6->Compare(string7), 0); ASSERT_EQ(string7->Compare(string6), 0); - // comapre with self + // compare with self ASSERT_EQ(string1->Compare(string1), 0); ASSERT_EQ(string2->Compare(string2), 0); ASSERT_EQ(string3->Compare(string3), 0); diff --git a/runtime/thread.cpp b/runtime/thread.cpp index 689bb11be1e1828329ac46d6f7c454b0776286c2..84b3b1e5d389cae109926e96c88d5653802d7b7f 100644 --- a/runtime/thread.cpp +++ b/runtime/thread.cpp @@ -248,7 +248,7 @@ bool MTManagedThread::IsInNativeCode() const void MTManagedThread::ManagedCodeBegin() { - // thread_frame_states_ should not be accessed without MutatorLock (as runtime could have been destoryed) + // thread_frame_states_ should not be accessed without MutatorLock (as runtime could have been destroyed) UpdateStatus(RUNNING); is_managed_scope_ = true; LOG_IF(HasClearStack(), FATAL, RUNTIME) << "stack should be not empty"; diff --git a/templates/common.rb b/templates/common.rb index 46066d388db8f6ac04a9dd15e0109811eb34225a..c190d8974bd5dff445276ef01f9ad1a44ae92ead 100755 --- a/templates/common.rb +++ b/templates/common.rb @@ -55,9 +55,9 @@ class Option < SimpleDelegator @expansion_map.each do |k, v| ret = "" if s.include?(k) - splitted = s.split(k); - for i in 1..splitted.length() - 1 - ret += v + ' + ' + Common::to_raw(splitted[i])+ ' + ' + split = s.split(k); + for i in 1..split.length() - 1 + ret += v + ' + ' + Common::to_raw(split[i])+ ' + ' end return ret.delete_suffix(' + ') end diff --git a/tests/cts-generator/cts-template/call.range.yaml b/tests/cts-generator/cts-template/call.range.yaml index ee4c5de0a86327b063d7bb44276975de63018bbc..b7e9eaed8cf46df7fd140ad90093aeaec95ee079 100644 --- a/tests/cts-generator/cts-template/call.range.yaml +++ b/tests/cts-generator/cts-template/call.range.yaml @@ -276,7 +276,7 @@ tests: - sig: call.range method_id, v:in:top acc: out:top format: [op_v_8_id_16] - description: Check 'call.range' when argument type of function and instuction mismatch. + description: Check 'call.range' when argument type of function and instruction mismatch. header-template: [] code-template: | %s diff --git a/tests/cts-generator/cts-template/call.short.yaml b/tests/cts-generator/cts-template/call.short.yaml index d1d19d211bd866751079c3f033696ba96afc6f1c..a87485326642d345ae8f7b594bf8c31071e57a1c 100644 --- a/tests/cts-generator/cts-template/call.short.yaml +++ b/tests/cts-generator/cts-template/call.short.yaml @@ -261,7 +261,7 @@ tests: - sig: call.short method_id, v1:in:top, v2:in:top acc: out:top format: [op_v1_4_v2_4_id_16] - description: Check 'call.short' when arguments of function and instuction parameters mismatch. + description: Check 'call.short' when arguments of function and instruction parameters mismatch. header-template: [] code-template: | .function void f1(%s) { @@ -301,7 +301,7 @@ tests: - sig: call.short method_id, v1:in:top, v2:in:top acc: out:top format: [op_v1_4_v2_4_id_16] - description: Check 'call.short' when argument type of function and instuction mismatch. + description: Check 'call.short' when argument type of function and instruction mismatch. header-template: [] code-template: | %s diff --git a/tests/cts-generator/cts-template/call.virt.negative.yaml b/tests/cts-generator/cts-template/call.virt.negative.yaml index 602efceac2321cd2a05f506f6cfff32b68d9792c..a84f56fe6d9594d2d2d844b83855de01ca6a83c2 100644 --- a/tests/cts-generator/cts-template/call.virt.negative.yaml +++ b/tests/cts-generator/cts-template/call.virt.negative.yaml @@ -506,7 +506,7 @@ tests: description: > Verifier should report when register type does not match function argument type. code-template: | - # Defenitions for all set of tests + # Definitions for all set of tests .record panda.String .record panda.Object @@ -635,7 +635,7 @@ tests: description: > Verifier should report when register type does not match function argument type. code-template: | - # Defenitions for all set of tests + # Definitions for all set of tests .record panda.String .record panda.Object diff --git a/tests/cts-generator/cts-template/call.virt.range.negative.yaml b/tests/cts-generator/cts-template/call.virt.range.negative.yaml index ca98b7a3e26193e25419b17a7c0c29f1b3cb9151..0cab05ea97a8fc11c1780116f1f6239630a910e3 100644 --- a/tests/cts-generator/cts-template/call.virt.range.negative.yaml +++ b/tests/cts-generator/cts-template/call.virt.range.negative.yaml @@ -498,7 +498,7 @@ tests: description: > Verifier should report when register type does not match function argument type. code-template: | - # Defenitions for all set of tests + # Definitions for all set of tests .record panda.String .record panda.Object @@ -624,7 +624,7 @@ tests: description: > Verifier should report when register type does not match function argument type. code-template: | - # Defenitions for all set of tests + # Definitions for all set of tests .record panda.String .record panda.Object diff --git a/tests/cts-generator/cts-template/call.yaml b/tests/cts-generator/cts-template/call.yaml index f3a877cca32807993fd389ce958fc45f983e0c1c..87a1dfa98bf0976e76a2ea88496e8dfe63a8f8bf 100644 --- a/tests/cts-generator/cts-template/call.yaml +++ b/tests/cts-generator/cts-template/call.yaml @@ -260,7 +260,7 @@ tests: - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top acc: out:top format: [op_v1_4_v2_4_v3_4_v4_4_id_16] - description: Check 'call' when arguments of function and instuction parameters mismatch. + description: Check 'call' when arguments of function and instruction parameters mismatch. header-template: [] code-template: | .function void f1(%s) { @@ -305,7 +305,7 @@ tests: - sig: call method_id, v1:in:top, v2:in:top, v3:in:top, v4:in:top acc: out:top format: [op_v1_4_v2_4_v3_4_v4_4_id_16] - description: Check 'call' when argument type of function and instuction mismatch. + description: Check 'call' when argument type of function and instruction mismatch. header-template: [] code-template: | %s diff --git a/tests/cts-generator/cts-template/lenarr.yaml b/tests/cts-generator/cts-template/lenarr.yaml index f36913d359740d479b97fe22ef2311fe2ac93020..682a91837cd3ec9a8996b66cf7180c4e2d131db6 100644 --- a/tests/cts-generator/cts-template/lenarr.yaml +++ b/tests/cts-generator/cts-template/lenarr.yaml @@ -51,7 +51,7 @@ tests: description: Get length of an array and put it into accumulator. commands: - file-name: "prim_array" - description: Check 'lenarr' returns correct array lenght with array of primitives. + description: Check 'lenarr' returns correct array length with array of primitives. isa: instructions: - sig: lenarr v:in:top[] @@ -83,7 +83,7 @@ tests: - values: [0x100000] - file-name: "ref_array_p" - description: Check 'lenarr' returns correct array lenght with array of objects in Panda Assembly context. + description: Check 'lenarr' returns correct array length with array of objects in Panda Assembly context. isa: instructions: - sig: lenarr v:in:top[] diff --git a/tests/verifier-tests/issue_1981.pa b/tests/verifier-tests/issue_1981.pa index f4f159afdb6d0fad2a597acdf85e46588d848880..c75fc0ccec0db31c5dadec92f13874737a708824 100644 --- a/tests/verifier-tests/issue_1981.pa +++ b/tests/verifier-tests/issue_1981.pa @@ -16,7 +16,7 @@ .function void A.constructor(A a0) { return.void } -# Defenitions for all set of tests +# Definitions for all set of tests .record panda.String .record panda.Object diff --git a/verification/debug/allowlist/allowlist.cpp b/verification/debug/allowlist/allowlist.cpp index d0be5fdf1faa8d21b9b3bf442f3e134cdd58c44b..7fe73ac8c93362940496499b7dc1c2923b07ec93 100644 --- a/verification/debug/allowlist/allowlist.cpp +++ b/verification/debug/allowlist/allowlist.cpp @@ -42,13 +42,13 @@ void AllowlistMethodIdCalculationHandler(uint32_t class_hash, uint32_t method_ha if (static_cast(k) == AllowlistKind::CLASS) { if (name_hash_local[k]->count(class_hash) > 0) { LOG(DEBUG, VERIFIER) << "Method with class hash 0x" << std::hex << class_hash << ", id 0x" << id - << " was succesfully added to allowlist"; + << " was successfully added to allowlist"; id_local[k]->insert(id); } } else { if (name_hash_local[k]->count(method_hash) > 0) { LOG(DEBUG, VERIFIER) << "Method with hash 0x" << std::hex << method_hash << ", id 0x" << id - << " was succesfully added to allowlist"; + << " was successfully added to allowlist"; id_local[k]->insert(id); } } diff --git a/verification/type/tests/type_system_test.cpp b/verification/type/tests/type_system_test.cpp index 6a4885d599e9007f03e018bb1081c8004c61103d..9c730f8365dc8d0c5d2a2af8da38b18ddc92c2ed 100644 --- a/verification/type/tests/type_system_test.cpp +++ b/verification/type/tests/type_system_test.cpp @@ -135,7 +135,7 @@ TEST_F(VerifierTest, TypeSystemClosureAtTheEnd) i8 << (i16 | i32) << i64; (u8 | u16) << (u32 | u64); - // bofore closure all methods are unrelated + // before closure all methods are unrelated EXPECT_FALSE(method2 <= method1); EXPECT_FALSE(method1 <= method2);