浏览代码

Fix some spelling issues (#3385)

Fix some of the spelling issues found by CSpell.
Benbuck Nason 1 年之前
父节点
当前提交
ca61184ced

+ 1 - 1
.github/workflows/build_llvm_libraries.yml

@@ -43,7 +43,7 @@ jobs:
         run: /usr/bin/env python3 -m pip install -r requirements.txt --break-system-packages
         working-directory: build-scripts
 
-      - name: retrive the last commit ID
+      - name: retrieve the last commit ID
         id: get_last_commit
         run: echo "last_commit=$(GH_TOKEN=${{ secrets.GITHUB_TOKEN }} /usr/bin/env python3 ./build_llvm.py --llvm-ver)" >> $GITHUB_OUTPUT
         working-directory: build-scripts

+ 2 - 2
ci/coding_guidelines_check.py

@@ -57,7 +57,7 @@ def pre_flight_check(root: pathlib) -> bool:
     def check_aspell(root):
         return True
 
-    def check_clang_foramt(root: pathlib) -> bool:
+    def check_clang_format(root: pathlib) -> bool:
         if not locate_command(CLANG_FORMAT_CMD):
             return False
 
@@ -74,7 +74,7 @@ def pre_flight_check(root: pathlib) -> bool:
     def check_git_clang_format() -> bool:
         return locate_command(GIT_CLANG_FORMAT_CMD)
 
-    return check_aspell(root) and check_clang_foramt(root) and check_git_clang_format()
+    return check_aspell(root) and check_clang_format(root) and check_git_clang_format()
 
 
 def run_clang_format(file_path: pathlib, root: pathlib) -> bool:

+ 4 - 4
core/config.h

@@ -304,7 +304,7 @@
 #define WASM_DISABLE_STACK_HW_BOUND_CHECK 0
 #endif
 
-/* Disable SIMD unless it is manualy enabled somewhere */
+/* Disable SIMD unless it is manually enabled somewhere */
 #ifndef WASM_ENABLE_SIMD
 #define WASM_ENABLE_SIMD 0
 #endif
@@ -445,7 +445,7 @@
 #endif
 
 /* Reserved bytes to the native thread stack boundary, throw native
- * stack overflow exception if the guard boudary is reached
+ * stack overflow exception if the guard boundary is reached
  *
  * WASM_STACK_GUARD_SIZE needs to be large enough for:
  *
@@ -461,7 +461,7 @@
  * - aot runtime functions
  *   eg. aot_enlarge_memory.
  *
- * - w/o hw bound check, the intepreter loop
+ * - w/o hw bound check, the interpreter loop
  *
  *   the stack consumption heavily depends on compiler settings,
  *   especially for huge functions like the classic interpreter's
@@ -514,7 +514,7 @@
 /*
  * Use a larger default for platforms like macOS/Linux.
  *
- * For example, the classic intepreter loop which ended up with a trap
+ * For example, the classic interpreter loop which ended up with a trap
  * (wasm_runtime_set_exception) would consume about 2KB stack on x86-64
  * macOS. On Ubuntu amd64 20.04, it seems to consume a bit more.
  *

+ 7 - 7
core/iwasm/aot/aot_loader.c

@@ -94,7 +94,7 @@ check_buf(const uint8 *buf, const uint8 *buf_end, uint32 length,
 {
     if ((uintptr_t)buf + length < (uintptr_t)buf
         || (uintptr_t)buf + length > (uintptr_t)buf_end) {
-        set_error_buf(error_buf, error_buf_size, "unexpect end");
+        set_error_buf(error_buf, error_buf_size, "unexpected end");
         return false;
     }
     return true;
@@ -323,13 +323,13 @@ load_string(uint8 **p_buf, const uint8 *buf_end, AOTModule *module,
 #endif
     else if (is_load_from_file_buf) {
         /* The string is always terminated with '\0', use it directly.
-         * In this case, the file buffer can be reffered to after loading.
+         * In this case, the file buffer can be referred to after loading.
          */
         bh_assert(p[str_len - 1] == '\0');
         str = (char *)p;
     }
     else {
-        /* Load from sections, the file buffer cannot be reffered to
+        /* Load from sections, the file buffer cannot be referred to
            after loading, we must create another string and insert it
            into const string set */
         bh_assert(p[str_len - 1] == '\0');
@@ -2518,7 +2518,7 @@ load_function_section(const uint8 *buf, const uint8 *buf_end, AOTModule *module,
 #if defined(BUILD_TARGET_XTENSA)
     /*
      * For Xtensa XIP, real func_count is doubled, including aot_func and
-     * aot_func_internal, so need to multipy func_count by 2 here.
+     * aot_func_internal, so need to multiply func_count by 2 here.
      */
     if (module->is_indirect_mode) {
         func_count *= 2;
@@ -3912,7 +3912,7 @@ resolve_execute_mode(const uint8 *buf, uint32 size, bool *p_mode,
     p += 8;
     while (p < p_end) {
         read_uint32(p, p_end, section_type);
-        if (section_type <= AOT_SECTION_TYPE_SIGANATURE) {
+        if (section_type <= AOT_SECTION_TYPE_SIGNATURE) {
             read_uint32(p, p_end, section_size);
             CHECK_BUF(p, p_end, section_size);
             if (section_type == AOT_SECTION_TYPE_TARGET_INFO) {
@@ -3927,7 +3927,7 @@ resolve_execute_mode(const uint8 *buf, uint32 size, bool *p_mode,
                 break;
             }
         }
-        else { /* section_type > AOT_SECTION_TYPE_SIGANATURE */
+        else { /* section_type > AOT_SECTION_TYPE_SIGNATURE */
             set_error_buf(error_buf, error_buf_size,
                           "resolve execute mode failed");
             break;
@@ -3966,7 +3966,7 @@ create_sections(AOTModule *module, const uint8 *buf, uint32 size,
     p += 8;
     while (p < p_end) {
         read_uint32(p, p_end, section_type);
-        if (section_type < AOT_SECTION_TYPE_SIGANATURE
+        if (section_type < AOT_SECTION_TYPE_SIGNATURE
             || section_type == AOT_SECTION_TYPE_CUSTOM) {
             read_uint32(p, p_end, section_size);
             CHECK_BUF(p, p_end, section_size);

+ 8 - 8
core/iwasm/aot/aot_runtime.c

@@ -1119,7 +1119,7 @@ init_func_ptrs(AOTModuleInstance *module_inst, AOTModule *module,
 #if defined(BUILD_TARGET_XTENSA)
     /*
      * For Xtensa XIP, real func_count is doubled, including aot_func and
-     * aot_func_internal, so need to multipy func_count by 2 here.
+     * aot_func_internal, so need to multiply func_count by 2 here.
      */
     if (module->is_indirect_mode) {
         func_count *= 2;
@@ -1166,7 +1166,7 @@ init_func_type_indexes(AOTModuleInstance *module_inst, AOTModule *module,
 #if defined(BUILD_TARGET_XTENSA)
     /*
      * For Xtensa XIP, real func_count is doubled, including aot_func and
-     * aot_func_internal, so need to multipy func_count by 2 here.
+     * aot_func_internal, so need to multiply func_count by 2 here.
      */
     if (module->is_indirect_mode) {
         func_count *= 2;
@@ -1394,7 +1394,7 @@ execute_post_instantiate_functions(AOTModuleInstance *module_inst,
     }
 #endif
 
-    /* Execute start function for both main insance and sub instance */
+    /* Execute start function for both main instance and sub instance */
     if (module->start_function) {
         AOTFunctionInstance start_func = { 0 };
         uint32 func_type_idx;
@@ -2221,8 +2221,8 @@ aot_call_function(WASMExecEnv *exec_env, AOTFunctionInstance *function,
 
 #if WASM_ENABLE_AOT_STACK_FRAME != 0
         /* Free all frames allocated, note that some frames
-           may be allocated in AOT code and havent' been
-           freed if exception occured */
+           may be allocated in AOT code and haven't been
+           freed if exception occurred */
         while (exec_env->cur_frame != prev_frame)
             aot_free_frame(exec_env);
 #endif
@@ -2291,8 +2291,8 @@ aot_call_function(WASMExecEnv *exec_env, AOTFunctionInstance *function,
 
 #if WASM_ENABLE_AOT_STACK_FRAME != 0
         /* Free all frames allocated, note that some frames
-           may be allocated in AOT code and havent' been
-           freed if exception occured */
+           may be allocated in AOT code and haven't been
+           freed if exception occurred */
         while (exec_env->cur_frame != prev_frame)
             aot_free_frame(exec_env);
 #endif
@@ -4296,7 +4296,7 @@ aot_dump_pgo_prof_data_to_buf(AOTModuleInstance *module_inst, char *buf,
             LLVMProfileData_64 *prof_data_64 = (LLVMProfileData_64 *)buf;
 
             /* Convert LLVMProfileData to LLVMProfileData_64, the pointer width
-               in the output file is alawys 8 bytes */
+               in the output file is always 8 bytes */
             prof_data = (LLVMProfileData *)module->data_sections[i].data;
             prof_data_64->func_md5 = prof_data->func_md5;
             prof_data_64->func_hash = prof_data->func_hash;

+ 2 - 2
core/iwasm/aot/aot_runtime.h

@@ -43,7 +43,7 @@ typedef enum AOTSectionType {
     AOT_SECTION_TYPE_FUNCTION = 3,
     AOT_SECTION_TYPE_EXPORT = 4,
     AOT_SECTION_TYPE_RELOCATION = 5,
-    AOT_SECTION_TYPE_SIGANATURE = 6,
+    AOT_SECTION_TYPE_SIGNATURE = 6,
     AOT_SECTION_TYPE_CUSTOM = 100,
 } AOTSectionType;
 
@@ -420,7 +420,7 @@ typedef struct LLVMProfileData {
     uint16 num_value_sites[2];
 } LLVMProfileData;
 
-/* The profiling data for writting to the output file, the width of
+/* The profiling data for writing to the output file, the width of
    pointer is 8 bytes suppose we always use wamrc and llvm-profdata
    with 64-bit mode */
 typedef struct LLVMProfileData_64 {

+ 2 - 2
core/iwasm/common/gc/gc_object.h

@@ -13,7 +13,7 @@ extern "C" {
 #endif
 
 /**
- * Object header of a WASM object, as the adddress of allocated memory
+ * Object header of a WASM object, as the address of allocated memory
  * must be 8-byte aligned, the lowest 3 bits are zero, we use them to
  * mark the object:
  *   bits[0] is 1: the object is an externref object
@@ -85,7 +85,7 @@ typedef struct WASMArrayObject {
     /* Must be pointer of WASMRttObject of array type */
     WASMObjectHeader header;
     /* (<array length> << 2) | <array element size>,
-     * elem_count = lenght >> 2
+     * elem_count = length >> 2
      * elem_size = 2 ^ (length & 0x3)
      */
     uint32 length;

+ 3 - 3
core/iwasm/common/wasm_application.c

@@ -127,7 +127,7 @@ execute_main(WASMModuleInstanceCommon *module_inst, int32 argc, char *argv[])
 #if WASM_ENABLE_THREAD_MGR != 0
         if (ret) {
             /* On a successful return from the `_start` function,
-               we terminate other threads by mimicing wasi:proc_exit(0).
+               we terminate other threads by mimicking wasi:proc_exit(0).
 
                Note:
                - A return from the `main` function is an equivalent of
@@ -516,11 +516,11 @@ execute_func(WASMModuleInstanceCommon *module_inst, const char *name,
             case VALUE_TYPE_V128:
             {
                 /* it likes 0x123\0x234 or 123\234 */
-                /* retrive first i64 */
+                /* retrieve first i64 */
                 *(uint64 *)(argv1 + p) = strtoull(argv[i], &endptr, 0);
                 /* skip \ */
                 endptr++;
-                /* retrive second i64 */
+                /* retrieve second i64 */
                 *(uint64 *)(argv1 + p + 2) = strtoull(endptr, &endptr, 0);
                 p += 4;
                 break;

+ 7 - 7
core/iwasm/common/wasm_c_api.c

@@ -536,7 +536,7 @@ search_thread_local_store_num(Vector *stores_by_tid, korp_tid tid,
 #endif
 
 static unsigned
-retrive_thread_local_store_num(Vector *stores_by_tid, korp_tid tid)
+retrieve_thread_local_store_num(Vector *stores_by_tid, korp_tid tid)
 {
 #ifndef os_thread_local_attribute
     unsigned i = 0;
@@ -664,8 +664,8 @@ wasm_store_new(wasm_engine_t *engine)
     if (!engine || singleton_engine != engine)
         return NULL;
 
-    if (!retrive_thread_local_store_num(&engine->stores_by_tid,
-                                        os_self_thread())) {
+    if (!retrieve_thread_local_store_num(&engine->stores_by_tid,
+                                         os_self_thread())) {
         if (!wasm_runtime_init_thread_env()) {
             LOG_ERROR("init thread environment failed");
             return NULL;
@@ -734,8 +734,8 @@ wasm_store_delete(wasm_store_t *store)
 
     if (decrease_thread_local_store_num(&singleton_engine->stores_by_tid,
                                         os_self_thread())) {
-        if (!retrive_thread_local_store_num(&singleton_engine->stores_by_tid,
-                                            os_self_thread())) {
+        if (!retrieve_thread_local_store_num(&singleton_engine->stores_by_tid,
+                                             os_self_thread())) {
             wasm_runtime_destroy_thread_env();
         }
     }
@@ -2263,7 +2263,7 @@ wasm_module_new_ex(wasm_store_t *store, const wasm_byte_vec_t *binary,
         result = result || (pkg_type == Wasm_Module_AoT);
 #endif
         if (!result) {
-            LOG_VERBOSE("current building isn't compatiable with the module,"
+            LOG_VERBOSE("current building isn't compatible with the module,"
                         "may need recompile");
             goto quit;
         }
@@ -3386,7 +3386,7 @@ wasm_func_call(const wasm_func_t *func, const wasm_val_vec_t *params,
         }
     }
 
-    /* copy parametes */
+    /* copy parameters */
     if (param_count
         && !params_to_argv(params, wasm_functype_params(func->type), argv,
                            &argc)) {

+ 2 - 2
core/iwasm/common/wasm_c_api_internal.h

@@ -71,7 +71,7 @@ struct wasm_memorytype_t {
 
 struct wasm_externtype_t {
     uint32 extern_kind;
-    /* reservered space */
+    /* reserved space */
     uint8 data[1];
 };
 
@@ -205,7 +205,7 @@ struct wasm_extern_t {
     wasm_name_t *module_name;
     wasm_name_t *name;
     wasm_externkind_t kind;
-    /* reservered space */
+    /* reserved space */
     uint8 data[1];
 };
 

+ 1 - 1
core/iwasm/common/wasm_exec_env.c

@@ -202,7 +202,7 @@ wasm_exec_env_destroy(WASMExecEnv *exec_env)
         wasm_cluster_wait_for_all_except_self(cluster, exec_env);
 #if WASM_ENABLE_DEBUG_INTERP != 0
         /* Must fire exit event after other threads exits, otherwise
-           the stopped thread will be overrided by other threads */
+           the stopped thread will be overriden by other threads */
         wasm_cluster_thread_exited(exec_env);
 #endif
         /* We have waited for other threads, this is the only alive thread, so

+ 4 - 4
core/iwasm/common/wasm_native.c

@@ -71,7 +71,7 @@ uint32
 get_lib_rats_export_apis(NativeSymbol **p_lib_rats_apis);
 
 static bool
-compare_type_with_signautre(uint8 type, const char signature)
+compare_type_with_signature(uint8 type, const char signature)
 {
     const char num_sig_map[] = { 'F', 'f', 'I', 'i' };
 
@@ -122,10 +122,10 @@ check_symbol_signature(const WASMFuncType *type, const char *signature)
         sig = *p++;
 
         /* a f64/f32/i64/i32/externref parameter */
-        if (compare_type_with_signautre(type->types[i], sig))
+        if (compare_type_with_signature(type->types[i], sig))
             continue;
 
-        /* a pointer/string paramter */
+        /* a pointer/string parameter */
         if (type->types[i] != VALUE_TYPE_I32)
             /* pointer and string must be i32 type */
             return false;
@@ -156,7 +156,7 @@ check_symbol_signature(const WASMFuncType *type, const char *signature)
             return false;
 
         /* result types includes: f64,f32,i64,i32,externref */
-        if (!compare_type_with_signautre(type->types[i], *p))
+        if (!compare_type_with_signature(type->types[i], *p))
             return false;
 
         p++;

+ 8 - 8
core/iwasm/common/wasm_runtime_common.c

@@ -922,7 +922,7 @@ wasm_runtime_is_xip_file(const uint8 *buf, uint32 size)
             read_uint16(p, p_end, e_type);
             return (e_type == E_TYPE_XIP) ? true : false;
         }
-        else if (section_type >= AOT_SECTION_TYPE_SIGANATURE) {
+        else if (section_type >= AOT_SECTION_TYPE_SIGNATURE) {
             return false;
         }
         p += section_size;
@@ -1034,7 +1034,7 @@ wasm_runtime_register_module_internal(const char *module_name,
             }
         }
         else {
-            /* module has empyt name, reset it */
+            /* module has empty name, reset it */
             node->module_name = module_name;
             return true;
         }
@@ -2150,7 +2150,7 @@ wasm_runtime_finalize_call_function(WASMExecEnv *exec_env,
     bh_assert((argv && ret_argv) || (argc == 0));
 
     if (argv == ret_argv) {
-        /* no need to transfrom externref results */
+        /* no need to transform externref results */
         return true;
     }
 
@@ -2823,7 +2823,7 @@ void
 wasm_runtime_set_bounds_checks(WASMModuleInstanceCommon *module_inst,
                                bool enable)
 {
-    /* Alwary disable bounds checks if hw bounds checks enabled */
+    /* Always disable bounds checks if hw bounds checks is enabled */
 #ifdef OS_ENABLE_HW_BOUND_CHECK
     enable = false;
 #endif
@@ -5892,7 +5892,7 @@ wasm_externref_ref2obj(uint32 externref_idx, void **p_extern_obj)
 {
     ExternRefMapNode *node;
 
-    /* catch a `ref.null` vairable */
+    /* catch a `ref.null` variable */
     if (externref_idx == NULL_REF) {
         *p_extern_obj = NULL;
         return true;
@@ -6866,7 +6866,7 @@ wasm_runtime_load_depended_module(const WASMModuleCommon *parent_module,
         goto delete_loading_module;
     }
     if (get_package_type(buffer, buffer_size) != parent_module->module_type) {
-        LOG_DEBUG("moudle %s type error", sub_module_name);
+        LOG_DEBUG("module %s type error", sub_module_name);
         goto destroy_file_buffer;
     }
 
@@ -7130,7 +7130,7 @@ wasm_runtime_detect_native_stack_overflow(WASMExecEnv *exec_env)
     uint8 *boundary = exec_env->native_stack_boundary;
     RECORD_STACK_USAGE(exec_env, (uint8 *)&boundary);
     if (boundary == NULL) {
-        /* the platfrom doesn't support os_thread_get_stack_boundary */
+        /* the platform doesn't support os_thread_get_stack_boundary */
         return true;
     }
 #if defined(OS_ENABLE_HW_BOUND_CHECK) && WASM_DISABLE_STACK_HW_BOUND_CHECK == 0
@@ -7153,7 +7153,7 @@ wasm_runtime_detect_native_stack_overflow_size(WASMExecEnv *exec_env,
     uint8 *boundary = exec_env->native_stack_boundary;
     RECORD_STACK_USAGE(exec_env, (uint8 *)&boundary);
     if (boundary == NULL) {
-        /* the platfrom doesn't support os_thread_get_stack_boundary */
+        /* the platform doesn't support os_thread_get_stack_boundary */
         return true;
     }
 #if defined(OS_ENABLE_HW_BOUND_CHECK) && WASM_DISABLE_STACK_HW_BOUND_CHECK == 0

+ 1 - 1
core/iwasm/common/wasm_runtime_common.h

@@ -909,7 +909,7 @@ WASMExport *
 loader_find_export(const WASMModuleCommon *module, const char *module_name,
                    const char *field_name, uint8 export_kind, char *error_buf,
                    uint32 error_buf_size);
-#endif /* WASM_ENALBE_MULTI_MODULE */
+#endif /* WASM_ENABLE_MULTI_MODULE */
 
 bool
 wasm_runtime_is_built_in_module(const char *module_name);

+ 3 - 3
core/iwasm/compilation/aot_emit_aot_file.c

@@ -3090,7 +3090,7 @@ aot_resolve_target_info(AOTCompContext *comp_ctx, AOTObjectData *obj_data)
         && bin_type != LLVMBinaryTypeMachO32B
         && bin_type != LLVMBinaryTypeMachO64L
         && bin_type != LLVMBinaryTypeMachO64B) {
-        aot_set_last_error("invaid llvm binary bin_type.");
+        aot_set_last_error("invalid llvm binary bin_type.");
         return false;
     }
 
@@ -3166,13 +3166,13 @@ aot_resolve_target_info(AOTCompContext *comp_ctx, AOTObjectData *obj_data)
     else if (bin_type == LLVMBinaryTypeMachO32L
              || bin_type == LLVMBinaryTypeMachO32B) {
         /* TODO: parse file type of Mach-O 32 */
-        aot_set_last_error("invaid llvm binary bin_type.");
+        aot_set_last_error("invalid llvm binary bin_type.");
         return false;
     }
     else if (bin_type == LLVMBinaryTypeMachO64L
              || bin_type == LLVMBinaryTypeMachO64B) {
         /* TODO: parse file type of Mach-O 64 */
-        aot_set_last_error("invaid llvm binary bin_type.");
+        aot_set_last_error("invalid llvm binary bin_type.");
         return false;
     }
 

+ 1 - 1
core/iwasm/compilation/simd/simd_conversions.c

@@ -261,7 +261,7 @@ simd_integer_extension(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
         return false;
     }
 
-    /* retrive the low or high half */
+    /* retrieve the low or high half */
     if (!(sub_vector = LLVMBuildShuffleVector(comp_ctx->builder, vector,
                                               undef[itype], mask, "half"))) {
         HANDLE_FAILURE("LLVMBuildShuffleVector");

+ 2 - 2
core/iwasm/include/gc_export.h

@@ -707,7 +707,7 @@ wasm_externref_obj_to_internal_obj(const wasm_externref_obj_t externref_obj);
  * @param exec_env the execution environment
  * @param internal_obj the internal object
  *
- * @return wasm_externref_obj_t if create success, NULL othersise
+ * @return wasm_externref_obj_t if create success, NULL otherwise
  */
 WASM_RUNTIME_API_EXTERN wasm_externref_obj_t
 wasm_internal_obj_to_externref_obj(wasm_exec_env_t exec_env,
@@ -757,7 +757,7 @@ WASM_RUNTIME_API_EXTERN bool
 wasm_runtime_unpin_object(wasm_exec_env_t exec_env, wasm_obj_t obj);
 
 /**
- * Check whether an object is a struct objectc
+ * Check whether an object is a struct object
  *
  * @param obj the object to check
  *

+ 2 - 2
core/iwasm/include/wasm_c_api.h

@@ -96,7 +96,7 @@ typedef double float64_t;
 // Vectors
 // size: capacity
 // num_elems: current number of elements
-// size_of_elem: size of one elemen
+// size_of_elem: size of one element
 #define WASM_DECLARE_VEC(name, ptr_or_none) \
   typedef struct wasm_##name##_vec_t { \
     size_t size; \
@@ -183,7 +183,7 @@ typedef union MemAllocOption {
 } MemAllocOption;
 #endif /* MEM_ALLOC_OPTION_DEFINED */
 
-/* Runtime configration */
+/* Runtime configuration */
 struct wasm_config_t {
     mem_alloc_type_t mem_alloc_type;
     MemAllocOption mem_alloc_option;

+ 8 - 8
core/iwasm/include/wasm_export.h

@@ -428,7 +428,7 @@ wasm_runtime_register_module(const char *module_name, wasm_module_t module,
 
 /**
  * Check if there is already a loaded module named module_name in the
- * runtime. Repeately loading a module with the same name is not allowed.
+ * runtime. Repeatedly loading a module with the same name is not allowed.
  *
  * @param module_name indicate a name
  *
@@ -451,7 +451,7 @@ wasm_runtime_find_module_registered(const char *module_name);
  * @param buf the byte buffer which contains the WASM/AOT binary data,
  *        note that the byte buffer must be writable since runtime may
  *        change its content for footprint and performance purpose, and
- *        it must be referencable until wasm_runtime_unload is called
+ *        it must be referenceable until wasm_runtime_unload is called
  * @param size the size of the buffer
  * @param error_buf output of the exception info
  * @param error_buf_size the size of the exception string
@@ -921,7 +921,7 @@ wasm_runtime_call_wasm_v(wasm_exec_env_t exec_env,
  * @param exec_env the execution environment to call the function
  *   which must be created from wasm_create_exec_env()
  * @param element_index the function reference index, usually
- *   prvovided by the caller of a registed native function
+ *   provided by the caller of a registered native function
  * @param argc the number of arguments
  * @param argv the arguments.  If the function method has return value,
  *   the first (or first two in case 64-bit return value) element of
@@ -1169,7 +1169,7 @@ wasm_runtime_validate_native_addr(wasm_module_inst_t module_inst,
  * stable.)
  *
  * @param module_inst the WASM module instance
- * @param app_offset the app adress
+ * @param app_offset the app address
  *
  * @return the native address converted
  */
@@ -1439,7 +1439,7 @@ WASM_RUNTIME_API_EXTERN double
 wasm_runtime_sum_wasm_exec_time(wasm_module_inst_t module_inst);
 
 /**
- * Return execution time in ms of a given wasm funciton with
+ * Return execution time in ms of a given wasm function with
  * func_name. If the function is not found, return 0.
  *
  * @param module_inst the WASM module instance to profile
@@ -1706,7 +1706,7 @@ wasm_runtime_set_enlarge_mem_error_callback(
  * to all threads in the cluster.
  * It's an undefined behavior if multiple threads in a cluster call
  * wasm_runtime_set_context_spread on the same key
- * simultaneously. It's a caller's resposibility to perform necessary
+ * simultaneously. It's a caller's responsibility to perform necessary
  * serialization if necessary. For example:
  *
  * if (wasm_runtime_get_context(inst, key) == NULL) {
@@ -1726,7 +1726,7 @@ wasm_runtime_set_enlarge_mem_error_callback(
  *
  * Note: dynamic key create/destroy while instances are live is not
  * implemented as of writing this.
- * it's caller's resposibility to ensure destorying all module instances
+ * it's caller's responsibility to ensure destroying all module instances
  * before calling wasm_runtime_create_context_key or
  * wasm_runtime_destroy_context_key.
  * otherwise, it's an undefined behavior.
@@ -1787,7 +1787,7 @@ wasm_runtime_get_context(wasm_module_inst_t inst, void *key);
  *
  * The actual wake up mechanism used by `os_wakeup_blocking_op` is
  * platform-dependent. It might impose some platform-dependent restrictions
- * on the implementation of the blocking opearation.
+ * on the implementation of the blocking operation.
  *
  * For example, on POSIX-like platforms, a signal (by default SIGUSR1) is
  * used. The signal delivery configurations (eg. signal handler, signal mask,

+ 4 - 4
core/iwasm/interpreter/wasm.h

@@ -85,8 +85,8 @@ extern "C" {
 /**
  * Used by wamr compiler to represent object ref types,
  * including func object ref, externref object ref,
- * internal object ref, eq obect ref, i31 object ref,
- * struct object ref, array obect ref
+ * internal object ref, eq object ref, i31 object ref,
+ * struct object ref, array object ref
  */
 #define VALUE_TYPE_GC_REF 0x43
 
@@ -762,7 +762,7 @@ typedef struct WASIArguments {
     uint32 map_dir_count;
     const char **env;
     uint32 env_count;
-    /* in CIDR noation */
+    /* in CIDR notation */
     const char **addr_pool;
     uint32 addr_count;
     const char **ns_lookup_pool;
@@ -1021,7 +1021,7 @@ struct WASMModule {
     /**
      * func pointers of LLVM JITed (un-imported) functions
      * for non Multi-Tier JIT mode:
-     *   each pointer is set to the lookuped llvm jit func ptr, note that it
+     *   each pointer is set to the looked up llvm jit func ptr, note that it
      *   is a stub and will trigger the actual compilation when it is called
      * for Multi-Tier JIT mode:
      *   each pointer is inited as call_to_fast_jit code block, when the llvm

+ 5 - 5
core/iwasm/interpreter/wasm_runtime.c

@@ -1355,7 +1355,7 @@ execute_post_instantiate_functions(WASMModuleInstance *module_inst,
         }
     }
 
-    /* Execute start function for both main insance and sub instance */
+    /* Execute start function for both main instance and sub instance */
     if (start_func && !wasm_call_function(exec_env, start_func, 0, NULL)) {
         goto fail;
     }
@@ -2022,7 +2022,7 @@ wasm_instantiate(WASMModule *module, WASMModuleInstance *parent,
         * (module->import_memory_count + module->memory_count);
 
 #if WASM_ENABLE_JIT != 0
-    /* If the module dosen't have memory, reserve one mem_info space
+    /* If the module doesn't have memory, reserve one mem_info space
        with empty content to align with llvm jit compiler */
     if (module_inst_mem_inst_size == 0)
         module_inst_mem_inst_size = (uint64)sizeof(WASMMemoryInstance);
@@ -3791,13 +3791,13 @@ wasm_get_module_inst_mem_consumption(const WASMModuleInstance *module_inst,
         mem_conspn->app_heap_size += memory->heap_data_end - memory->heap_data;
         /* size of app heap structure */
         mem_conspn->memories_size += mem_allocator_get_heap_struct_size();
-        /* Module instance structures have been appened into the end of
+        /* Module instance structures have been appended into the end of
            module instance */
     }
 
     mem_conspn->tables_size =
         sizeof(WASMTableInstance *) * module_inst->table_count;
-    /* Table instance structures and table elements have been appened into
+    /* Table instance structures and table elements have been appended into
        the end of module instance */
 
     mem_conspn->functions_size =
@@ -3805,7 +3805,7 @@ wasm_get_module_inst_mem_consumption(const WASMModuleInstance *module_inst,
 
     mem_conspn->globals_size =
         sizeof(WASMGlobalInstance) * module_inst->e->global_count;
-    /* Global data has been appened into the end of module instance */
+    /* Global data has been appended into the end of module instance */
 
     mem_conspn->exports_size =
         sizeof(WASMExportFuncInstance) * module_inst->export_func_count;

+ 1 - 1
core/iwasm/libraries/thread-mgr/thread_manager.c

@@ -1194,7 +1194,7 @@ wait_for_thread_visitor(void *node, void *user_data)
 }
 
 void
-wams_cluster_wait_for_all(WASMCluster *cluster)
+wasm_cluster_wait_for_all(WASMCluster *cluster)
 {
     os_mutex_lock(&cluster->lock);
     cluster->processing = true;

+ 2 - 2
core/iwasm/libraries/thread-mgr/thread_manager.h

@@ -45,7 +45,7 @@ struct WASMCluster {
      * requests. This is a short-lived state, must be cleared immediately once
      * the processing finished.
      * This is used to avoid dead lock when one thread waiting another thread
-     * with lock, see wams_cluster_wait_for_all and wasm_cluster_terminate_all
+     * with lock, see wasm_cluster_wait_for_all and wasm_cluster_terminate_all
      */
     bool processing;
 #if WASM_ENABLE_DEBUG_INTERP != 0
@@ -135,7 +135,7 @@ wasm_cluster_terminate_all_except_self(WASMCluster *cluster,
                                        WASMExecEnv *exec_env);
 
 void
-wams_cluster_wait_for_all(WASMCluster *cluster);
+wasm_cluster_wait_for_all(WASMCluster *cluster);
 
 void
 wasm_cluster_wait_for_all_except_self(WASMCluster *cluster,

+ 1 - 1
core/shared/utils/bh_log.c

@@ -7,7 +7,7 @@
 
 /**
  * The verbose level of the log system.  Only those verbose logs whose
- * levels are less than or equal to this value are outputed.
+ * levels are less than or equal to this value are output.
  */
 static uint32 log_verbose_level = BH_LOG_LEVEL_WARNING;
 

+ 4 - 4
language-bindings/python/wasm-c-api/docs/design.md

@@ -70,11 +70,11 @@ Create a corresponding concept for every native structured data type includes
 
 #### Enum types
 
-For example, if there is a `enum wams_mutability_enum` in native.
+For example, if there is a `enum wasm_mutability_enum` in native.
 
 ```c
-typedef uint8_t wams_mutability_t;
-enum wams_mutability_enum {
+typedef uint8_t wasm_mutability_t;
+enum wasm_mutability_enum {
   WASM_CONST,
   WASM_VAR
 };
@@ -83,7 +83,7 @@ enum wams_mutability_enum {
 Use `ctypes.int`(or any integer types in ctypes) to represents its value directly.
 
 ```python
-# represents enum wams_mutability_enum
+# represents enum wasm_mutability_enum
 wasm_mutability_t = c_uint8
 
 WASM_CONST = 0

+ 1 - 1
product-mini/README.md

@@ -2,7 +2,7 @@
 
 iwasm is the executable binary built with WAMR VMcore supports WASI and command line interface. Refer to [**how to build wamr vmcore**](../doc/build_wamr.md) for all the supported CMAKE compilation variables.
 
-If you are building for ARM architecture on a X86 development machine, you can use the `CMAKE_TOOLCHAIN_FILE`  to set the toolchain file for cross compling.
+If you are building for ARM architecture on a X86 development machine, you can use the `CMAKE_TOOLCHAIN_FILE`  to set the toolchain file for cross compiling.
 
 ```
 cmake .. -DCMAKE_TOOLCHAIN_FILE=$TOOL_CHAIN_FILE  \

+ 2 - 2
product-mini/platforms/linux-sgx/enclave-sample/Enclave/Enclave.cpp

@@ -157,7 +157,7 @@ align_ptr(const uint8 *p, uint32 b)
 }
 
 #define AOT_SECTION_TYPE_TARGET_INFO 0
-#define AOT_SECTION_TYPE_SIGANATURE 6
+#define AOT_SECTION_TYPE_SIGNATURE 6
 #define E_TYPE_XIP 4
 
 #define CHECK_BUF(buf, buf_end, length)                      \
@@ -205,7 +205,7 @@ is_xip_file(const uint8 *buf, uint32 size)
             read_uint16(p, p_end, e_type);
             return (e_type == E_TYPE_XIP) ? true : false;
         }
-        else if (section_type >= AOT_SECTION_TYPE_SIGANATURE) {
+        else if (section_type >= AOT_SECTION_TYPE_SIGNATURE) {
             return false;
         }
         p += section_size;

+ 3 - 2
product-mini/platforms/posix/main.c

@@ -429,7 +429,7 @@ module_reader_callback(package_type_t module_type, const char *module_name,
 }
 
 static void
-moudle_destroyer(uint8 *buffer, uint32 size)
+module_destroyer_callback(uint8 *buffer, uint32 size)
 {
     if (!buffer) {
         return;
@@ -906,7 +906,8 @@ main(int argc, char *argv[])
 #endif
 
 #if WASM_ENABLE_MULTI_MODULE != 0
-    wasm_runtime_set_module_reader(module_reader_callback, moudle_destroyer);
+    wasm_runtime_set_module_reader(module_reader_callback,
+                                   module_destroyer_callback);
 #endif
 
     /* load WASM module */

+ 3 - 2
product-mini/platforms/windows/main.c

@@ -246,7 +246,7 @@ module_reader_callback(package_type_t module_type, const char *module_name,
 }
 
 static void
-moudle_destroyer(uint8 *buffer, uint32 size)
+module_destroyer_callback(uint8 *buffer, uint32 size)
 {
     if (!buffer) {
         return;
@@ -506,7 +506,8 @@ main(int argc, char *argv[])
 #endif
 
 #if WASM_ENABLE_MULTI_MODULE != 0
-    wasm_runtime_set_module_reader(module_reader_callback, moudle_destroyer);
+    wasm_runtime_set_module_reader(module_reader_callback,
+                                   module_destroyer_callback);
 #endif
 
     /* load WASM module */

+ 4 - 3
samples/multi-module/src/main.c

@@ -38,7 +38,7 @@ module_reader_callback(package_type_t module_type, const char *module_name,
 }
 
 static void
-moudle_destroyer(uint8 *buffer, uint32 size)
+module_destroyer_callback(uint8 *buffer, uint32 size)
 {
     if (!buffer) {
         return;
@@ -89,7 +89,8 @@ main(int argc, char *argv[])
 #if WASM_ENABLE_MULTI_MODULE != 0
     printf("- wasm_runtime_set_module_reader\n");
     /* set module reader and destroyer */
-    wasm_runtime_set_module_reader(module_reader_callback, moudle_destroyer);
+    wasm_runtime_set_module_reader(module_reader_callback,
+                                   module_destroyer_callback);
 #endif
 
     /* load WASM byte buffer from WASM bin file */
@@ -163,7 +164,7 @@ UNLOAD_MODULE:
     printf("- wasm_runtime_unload\n");
     wasm_runtime_unload(module);
 RELEASE_BINARY:
-    moudle_destroyer(file_buf, file_buf_size);
+    module_destroyer_callback(file_buf, file_buf_size);
 RELEASE_RUNTIME:
     printf("- wasm_runtime_destroy\n");
     wasm_runtime_destroy();

+ 4 - 4
samples/wasm-c-api/src/clone.c

@@ -181,13 +181,13 @@ vm_clone_from_instance(const wasm_vm_t *base)
 {
     /**
      * if do a clone of the level instantiated_module, need to malloc and
-     * initialie
-     *   - global. WASMGlobalIntance and global data
-     *   - memory. WAAMMemoryInstance, memory_data and heap
+     * initialize
+     *   - global. WASMGlobalInstance and global data
+     *   - memory. WASMMemoryInstance, memory_data and heap
      *   - table. WASMTableInstance, table_data
      *   - exports. all global, memory and table
      *
-     * it is almost everything in wasm_instantiate() except funciton.
+     * it is almost everything in wasm_instantiate() except function.
      */
     (void)base;
     printf("Unsupported\n");