Skip to content

Commit 412631a

Browse files
authored
fix: correct typos and improve comments across multiple files by codespell (#4116)
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
1 parent 73998e4 commit 412631a

File tree

108 files changed

+215
-215
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+215
-215
lines changed

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Code changes
1919
We Use Github Flow, So All Code Changes Happen Through Pull Requests. Pull requests are the best way to propose changes to the codebase. We actively welcome your pull requests:
2020

2121
- If you've added code that should be tested, add tests. Ensure the test suite passes.
22-
- Avoid use macros for different platforms. Use seperate folder of source files to host diffeent platform logic.
22+
- Avoid use macros for different platforms. Use separate folder of source files to host different platform logic.
2323
- Put macro definitions inside share_lib/include/config.h if you have to use macro.
2424
- Make sure your code lints and compliant to our coding style.
2525
- Extend the application library is highly welcome.

build-scripts/runtime_lib.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if (NOT DEFINED DEPS_DIR)
1414
set (DEPS_DIR ${WAMR_ROOT_DIR}/core/deps)
1515
endif ()
1616
if (NOT DEFINED SHARED_PLATFORM_CONFIG)
17-
# CMake file for platform configuration. The PLATFORM_SHARED_SOURCE varable
17+
# CMake file for platform configuration. The PLATFORM_SHARED_SOURCE variable
1818
# should point to a list of platform-specfic source files to compile.
1919
set (SHARED_PLATFORM_CONFIG ${SHARED_DIR}/platform/${WAMR_BUILD_PLATFORM}/shared_platform.cmake)
2020
endif ()

core/iwasm/aot/aot_loader.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1715,7 +1715,7 @@ load_types(const uint8 **p_buf, const uint8 *buf_end, AOTModule *module,
17151715
read_uint16(buf, buf_end, type_flag);
17161716

17171717
read_uint8(buf, buf_end, is_equivalence_type);
1718-
/* If there is an equivalence type, re-use it */
1718+
/* If there is an equivalence type, reuse it */
17191719
if (is_equivalence_type) {
17201720
uint8 u8;
17211721
/* padding */

core/iwasm/aot/arch/aot_reloc_xtensa.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ check_reloc_offset(uint32 target_section_size, uint64 reloc_offset,
154154
* CPU like esp32 can read and write data through the instruction bus, but only
155155
* in a word aligned manner; non-word-aligned access will cause a CPU exception.
156156
* This function uses a world aligned manner to write 16bit value to instruction
157-
* addreess.
157+
* address.
158158
*/
159159
static void
160160
put_imm16_to_addr(int16 imm16, int16 *addr)

core/iwasm/common/arch/invokeNative_aarch64.s

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ _invokeNative:
4545

4646
/* Now x20 points to stack args */
4747

48-
/* Directly call the fucntion if no args in stack */
48+
/* Directly call the function if no args in stack */
4949
cmp x21, #0
5050
beq call_func
5151

@@ -69,7 +69,7 @@ loop_stack_args: /* copy stack arguments to stack */
6969
call_func:
7070
mov x20, x30 /* save x30(lr) */
7171
blr x19
72-
mov sp, x22 /* restore sp which is saved before calling fuction*/
72+
mov sp, x22 /* restore sp which is saved before calling function*/
7373

7474
return:
7575
mov x30, x20 /* restore x30(lr) */

core/iwasm/common/arch/invokeNative_aarch64_simd.s

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ _invokeNative:
4343

4444
/* Now x20 points to stack args */
4545

46-
/* Directly call the fucntion if no args in stack */
46+
/* Directly call the function if no args in stack */
4747
cmp x21, #0
4848
beq call_func
4949

@@ -67,7 +67,7 @@ loop_stack_args: /* copy stack arguments to stack */
6767
call_func:
6868
mov x20, x30 /* save x30(lr) */
6969
blr x19
70-
mov sp, x22 /* restore sp which is saved before calling fuction*/
70+
mov sp, x22 /* restore sp which is saved before calling function*/
7171

7272
return:
7373
mov x30, x20 /* restore x30(lr) */

core/iwasm/common/arch/invokeNative_arm_vfp.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ _invokeNative:
5353
vldr s13, [r4, #52]
5454
vldr s14, [r4, #56]
5555
vldr s15, [r4, #60]
56-
/* Directly call the fucntion if no args in stack */
56+
/* Directly call the function if no args in stack */
5757
cmp r5, #0
5858
beq call_func
5959

core/iwasm/common/arch/invokeNative_riscv.S

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
/*
7-
* The float abi macros used bellow are from risc-v c api:
7+
* The float abi macros used below are from risc-v c api:
88
* https://github.com/riscv/riscv-c-api-doc/blob/master/riscv-c-api.md
99
*
1010
*/
@@ -130,7 +130,7 @@ _invokeNative:
130130
loop_stack_args:
131131
beq t2, x0, call_func
132132
RV_OP_LOADREG t5, 0(t1) /* load stack argument, t5 = argv[i] */
133-
RV_OP_STOREREG t5, 0(t4) /* store t5 to reseved stack, sp[j] = t5 */
133+
RV_OP_STOREREG t5, 0(t4) /* store t5 to reserved stack, sp[j] = t5 */
134134
addi t1, t1, RV_REG_SIZE /* move to next stack argument */
135135
addi t4, t4, RV_REG_SIZE /* move to next stack pointer */
136136
addi t2, t2, -1 /* decrease t2 every loop, nstacks = nstacks -1 */
@@ -142,7 +142,7 @@ call_func:
142142
/* restore registers pushed in stack or saved in another register */
143143
return:
144144
mv sp, fp /* restore sp saved in fp before function call */
145-
RV_OP_LOADREG fp, 0 * RV_REG_SIZE(sp) /* load previous frame poniter to fp register */
145+
RV_OP_LOADREG fp, 0 * RV_REG_SIZE(sp) /* load previous frame pointer to fp register */
146146
RV_OP_LOADREG ra, 1 * RV_REG_SIZE(sp) /* load previous return address to ra register */
147147
addi sp, sp, 2 * RV_REG_SIZE /* pop frame, restore sp */
148148
jr ra

core/iwasm/common/arch/invokeNative_thumb_vfp.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ _invokeNative:
5555
vldr s13, [r4, #52]
5656
vldr s14, [r4, #56]
5757
vldr s15, [r4, #60]
58-
/* Directly call the fucntion if no args in stack */
58+
/* Directly call the function if no args in stack */
5959
cmp r5, #0
6060
beq call_func
6161

core/iwasm/common/wasm_application.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ execute_main(WASMModuleInstanceCommon *module_inst, int32 argc, char *argv[])
118118

119119
#if WASM_ENABLE_LIBC_WASI != 0
120120
/* In wasi mode, we should call the function named "_start"
121-
which initializes the wasi envrionment and then calls
121+
which initializes the wasi environment and then calls
122122
the actual main function. Directly calling main function
123123
may cause exception thrown. */
124124
if ((func = wasm_runtime_lookup_wasi_start_function(module_inst))) {

core/iwasm/common/wasm_c_api.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2257,7 +2257,7 @@ wasm_module_new_ex(wasm_store_t *store, wasm_byte_vec_t *binary, LoadArgs *args)
22572257
if (!store || !binary || binary->size == 0 || binary->size > UINT32_MAX)
22582258
goto quit;
22592259

2260-
/* whether the combination of compilation flags are compatable with the
2260+
/* whether the combination of compilation flags are compatible with the
22612261
* package type */
22622262
{
22632263
PackageType pkg_type;

core/iwasm/common/wasm_exec_env.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ wasm_exec_env_destroy(WASMExecEnv *exec_env)
202202
wasm_cluster_wait_for_all_except_self(cluster, exec_env);
203203
#if WASM_ENABLE_DEBUG_INTERP != 0
204204
/* Must fire exit event after other threads exits, otherwise
205-
the stopped thread will be overriden by other threads */
205+
the stopped thread will be overridden by other threads */
206206
wasm_cluster_thread_exited(exec_env);
207207
#endif
208208
/* We have waited for other threads, this is the only alive thread, so

core/iwasm/compilation/aot_compiler.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ set_local_gc_ref(AOTCompFrame *frame, int n, LLVMValueRef value, uint8 ref_type)
790790
} \
791791
else { \
792792
char *func_name = #name; \
793-
/* AOT mode, delcare the function */ \
793+
/* AOT mode, declare the function */ \
794794
if (!(func = LLVMGetNamedFunction(func_ctx->module, func_name)) \
795795
&& !(func = LLVMAddFunction(func_ctx->module, func_name, \
796796
func_type))) { \

core/iwasm/compilation/aot_emit_aot_file.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3846,7 +3846,7 @@ aot_resolve_object_relocation_group(AOTObjectData *obj_data,
38463846
}
38473847
}
38483848

3849-
/* pares each relocation */
3849+
/* parse each relocation */
38503850
if (!(rel_itr = LLVMGetRelocations(rel_sec))) {
38513851
aot_set_last_error("llvm get relocations failed.");
38523852
return false;

core/iwasm/compilation/aot_emit_memory.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ aot_check_memory_overflow(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
345345
memory allocator, the hmu node includes hmu header and hmu
346346
memory, only the latter is returned to the caller as the
347347
allocated memory, the hmu header isn't returned so the
348-
first byte of the shared heap won't be accesed, (2) using
348+
first byte of the shared heap won't be accessed, (2) using
349349
IntUGT gets better performance than IntUGE in some cases */
350350
BUILD_ICMP(LLVMIntUGT, offset1, func_ctx->shared_heap_start_off,
351351
is_in_shared_heap, "is_in_shared_heap");
@@ -1101,7 +1101,7 @@ aot_compile_op_memory_grow(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx)
11011101
}
11021102
else {
11031103
char *func_name = "aot_enlarge_memory";
1104-
/* AOT mode, delcare the function */
1104+
/* AOT mode, declare the function */
11051105
if (!(func = LLVMGetNamedFunction(func_ctx->module, func_name))
11061106
&& !(func =
11071107
LLVMAddFunction(func_ctx->module, func_name, func_type))) {
@@ -1184,7 +1184,7 @@ check_bulk_memory_overflow(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
11841184
* Note: not throw the integer-overflow-exception here since it must
11851185
* have been thrown when converting float to integer before
11861186
*/
1187-
/* return addres directly if constant offset and inside memory space */
1187+
/* return address directly if constant offset and inside memory space */
11881188
if (LLVMIsEfficientConstInt(offset) && LLVMIsEfficientConstInt(bytes)) {
11891189
uint64 mem_offset = (uint64)LLVMConstIntGetZExtValue(offset);
11901190
uint64 mem_len = (uint64)LLVMConstIntGetZExtValue(bytes);

core/iwasm/compilation/aot_llvm.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1720,7 +1720,7 @@ aot_create_stack_sizes(const AOTCompData *comp_data, AOTCompContext *comp_ctx)
17201720
* This value is a placeholder, which will be replaced
17211721
* after the corresponding functions are compiled.
17221722
*
1723-
* Don't use zeros becasue LLVM can optimize them to
1723+
* Don't use zeros because LLVM can optimize them to
17241724
* zeroinitializer.
17251725
*/
17261726
values[i] = I32_NEG_ONE;
@@ -2354,7 +2354,7 @@ create_target_machine_detect_host(AOTCompContext *comp_ctx)
23542354
}
23552355

23562356
if (!LLVMTargetHasJIT(target)) {
2357-
aot_set_last_error("unspported JIT on this platform.");
2357+
aot_set_last_error("unsupported JIT on this platform.");
23582358
goto fail;
23592359
}
23602360

@@ -3412,7 +3412,7 @@ aot_get_native_symbol_index(AOTCompContext *comp_ctx, const char *symbol)
34123412

34133413
sym = bh_list_first_elem(&comp_ctx->native_symbols);
34143414

3415-
/* Lookup an existing symobl record */
3415+
/* Lookup an existing symbol record */
34163416

34173417
while (sym) {
34183418
if (strcmp(sym->symbol, symbol) == 0) {

core/iwasm/compilation/iwasm_compl.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ endif()
1717

1818
set (IWASM_COMPL_SOURCE ${source_all})
1919

20-
# Disalbe rtti to works with LLVM
20+
# Disable rtti to works with LLVM
2121

2222
if (MSVC)
2323
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-")

core/iwasm/compilation/simd/simd_int_arith.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ simd_integer_arith(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
3232
result = LLVMBuildMul(comp_ctx->builder, lhs, rhs, "product");
3333
break;
3434
default:
35-
HANDLE_FAILURE("Unsupport arith_op");
35+
HANDLE_FAILURE("Unsupported arith_op");
3636
break;
3737
}
3838

core/iwasm/fast-jit/cg/x86-64/jit_codegen_x86_64.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -423,15 +423,15 @@ jmp_from_label_to_label(x86::Assembler &a, bh_list *jmp_info_list,
423423

424424
/**
425425
* Encode detecting compare result register according to condition code
426-
* and then jumping to suitable label when the condtion is met
426+
* and then jumping to suitable label when the condition is met
427427
*
428428
* @param cc the compiler context
429429
* @param a the assembler to emit the code
430430
* @param jmp_info_list the jmp info list
431431
* @param label_src the index of src label
432432
* @param op the opcode of condition operation
433433
* @param r1 the label info when condition is met
434-
* @param r2 the label info when condition is unmet, do nonthing if VOID
434+
* @param r2 the label info when condition is unmet, do nothing if VOID
435435
* @param is_last_insn if current insn is the last insn of current block
436436
*
437437
* @return true if success, false if failed
@@ -2589,7 +2589,7 @@ alu_r_r_r_i32(x86::Assembler &a, ALU_OP op, int32 reg_no_dst, int32 reg_no1_src,
25892589
if (reg_no2_src == REG_EDX_IDX) {
25902590
/* convert `REM_S edx, eax, edx` into
25912591
`mov esi, edx` and `REM_S edx eax, rsi` to
2592-
avoid overwritting edx when a.cdq() */
2592+
avoid overwriting edx when a.cdq() */
25932593
a.mov(regs_i32[REG_I32_FREE_IDX], regs_i32[REG_EDX_IDX]);
25942594
reg_no2_src = REG_I32_FREE_IDX;
25952595
}
@@ -2609,7 +2609,7 @@ alu_r_r_r_i32(x86::Assembler &a, ALU_OP op, int32 reg_no_dst, int32 reg_no1_src,
26092609
if (reg_no2_src == REG_EDX_IDX) {
26102610
/* convert `REM_U edx, eax, edx` into
26112611
`mov esi, edx` and `REM_U edx eax, rsi` to
2612-
avoid overwritting edx when unsigned extend
2612+
avoid overwriting edx when unsigned extend
26132613
eax to edx:eax */
26142614
a.mov(regs_i32[REG_I32_FREE_IDX], regs_i32[REG_EDX_IDX]);
26152615
reg_no2_src = REG_I32_FREE_IDX;
@@ -5602,7 +5602,7 @@ lower_select(JitCompContext *cc, x86::Assembler &a, COND_OP op, JitReg r0,
56025602
a.jmp(imm); \
56035603
if (!err_handler->err) { \
56045604
/* The offset written by asmjit is always 0, we patch it \
5605-
again, 6 is the size of jmp instruciton */ \
5605+
again, 6 is the size of jmp instruction */ \
56065606
stream = (char *)a.code()->sectionById(0)->buffer().data() \
56075607
+ a.code()->sectionById(0)->buffer().size() - 6; \
56085608
_offset = label_offsets[label_dst] \
@@ -6169,7 +6169,7 @@ lower_return(JitCompContext *cc, x86::Assembler &a, JitInsn *insn)
61696169
* Replace all the jmp address pre-saved when the code cache hasn't been
61706170
* allocated with actual address after code cache allocated
61716171
*
6172-
* @param cc compiler context containting the allocated code cacha info
6172+
* @param cc compiler context containing the allocated code cacha info
61736173
* @param jmp_info_list the jmp info list
61746174
*/
61756175
static void
@@ -6557,7 +6557,7 @@ at_cmpxchg_r_ra_base_r_offset_imm(x86::Assembler &a, uint32 bytes_dst,
65576557
* @param a the assembler to emit the code
65586558
* @param bytes_dst the bytes number of the data to actual operated on(load,
65596559
* compare, replacement) could be 1(byte), 2(short), 4(int32), 8(int64)
6560-
* @param data_xchg the immediate data for exchange(conditionally replacment
6560+
* @param data_xchg the immediate data for exchange(conditionally replacement
65616561
* value)
65626562
* @param reg_no_base the no of register that stores the base address
65636563
* of src&dst memory
@@ -6587,7 +6587,7 @@ at_cmpxchg_imm_ra_base_r_offset_r(x86::Assembler &a, uint32 bytes_dst,
65876587
* @param a the assembler to emit the code
65886588
* @param bytes_dst the bytes number of the data to actual operated on(load,
65896589
* compare, replacement) could be 1(byte), 2(short), 4(int32), 8(int64)
6590-
* @param data_xchg the immediate data for exchange(conditionally replacment
6590+
* @param data_xchg the immediate data for exchange(conditionally replacement
65916591
* value)
65926592
* @param reg_no_base the no of register that stores the base address
65936593
* of src&dst memory
@@ -8820,7 +8820,7 @@ jit_codegen_compile_call_to_fast_jit(const WASMModule *module, uint32 func_idx)
88208820

88218821
/* If yes, set eax to 0, return to caller */
88228822

8823-
/* Pop all integer arument registers */
8823+
/* Pop all integer argument registers */
88248824
for (i = 0; i < MAX_REG_INTS; i++) {
88258825
a.pop(regs_i64[reg_idx_of_int_args[i]]);
88268826
}
@@ -9084,7 +9084,7 @@ jit_codegen_compile_call_to_fast_jit(const WASMModule *module, uint32 func_idx)
90849084
a.mov(m, x86::rdx);
90859085
}
90869086

9087-
/* Pop all integer arument registers */
9087+
/* Pop all integer argument registers */
90889088
for (i = 0; i < MAX_REG_INTS; i++) {
90899089
a.pop(regs_i64[reg_idx_of_int_args[i]]);
90909090
}

core/iwasm/fast-jit/fe/jit_emit_compare.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jit_compile_op_compare_integer(JitCompContext *cc, IntCond cond, bool is64Bit)
1414
JitReg lhs, rhs, res, const_zero, const_one;
1515

1616
if (cond < INT_EQZ || cond > INT_GE_U) {
17-
jit_set_last_error(cc, "unsupported comparation operation");
17+
jit_set_last_error(cc, "unsupported comparison operation");
1818
goto fail;
1919
}
2020

core/iwasm/fast-jit/fe/jit_emit_control.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,7 @@ jit_compile_op_br_table(JitCompContext *cc, uint32 *br_depths, uint32 br_count,
12301230
copy_arities = check_copy_arities(block_dst, cc->jit_frame);
12311231

12321232
if (!copy_arities) {
1233-
/* No need to create new basic block, direclty jump to
1233+
/* No need to create new basic block, directly jump to
12341234
the existing basic block when no need to copy arities */
12351235
if (i == br_count) {
12361236
if (block_dst->label_type == LABEL_TYPE_LOOP) {

core/iwasm/fast-jit/jit_frontend.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ get_global_base_offset(const WASMModule *module)
3131
* (module->import_memory_count + module->memory_count);
3232

3333
#if WASM_ENABLE_JIT != 0
34-
/* If the module dosen't have memory, reserve one mem_info space
34+
/* If the module doesn't have memory, reserve one mem_info space
3535
with empty content to align with llvm jit compiler */
3636
if (mem_inst_size == 0)
3737
mem_inst_size = (uint32)sizeof(WASMMemoryInstance);
@@ -1169,7 +1169,7 @@ init_func_translation(JitCompContext *cc)
11691169
time_started = jit_cc_new_reg_I64(cc);
11701170
/* Call os_time_thread_cputime_us() to get time_started firstly
11711171
as there is stack frame switching below, calling native in them
1172-
may cause register spilling work inproperly */
1172+
may cause register spilling work improperly */
11731173
if (!jit_emit_callnative(cc, os_time_thread_cputime_us, time_started, NULL,
11741174
0)) {
11751175
return NULL;

0 commit comments

Comments
 (0)