Skip to content

Commit 80afb01

Browse files
committed
Merge branch 'dev/checkpoint_and_restore' into main
1 parent 7cc3839 commit 80afb01

File tree

6 files changed

+17
-40
lines changed

6 files changed

+17
-40
lines changed

core/iwasm/aot/aot_runtime.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,8 @@ memories_instantiate(AOTModuleInstance *module_inst, AOTModuleInstance *parent,
10551055

10561056
#if WASM_ENABLE_SHARED_MEMORY != 0
10571057
/* Currently we have only one memory instance */
1058-
bool is_shared_memory = module->memories[0].memory_flags & 0x02 ? true : false;
1058+
bool is_shared_memory =
1059+
module->memories[0].memory_flags & 0x02 ? true : false;
10591060
if (is_shared_memory && parent != NULL) {
10601061
/* Ignore setting memory init data if the memory has been initialized */
10611062
return true;

core/iwasm/common/wasm_runtime_common.h

+6
Original file line numberDiff line numberDiff line change
@@ -1216,6 +1216,12 @@ wasm_runtime_checkpoint(wasm_module_inst_t module_inst, char *file);
12161216
bool
12171217
wasm_runtime_restore(wasm_module_inst_t module_inst, char *file, char *file1);
12181218
#endif
1219+
WASM_RUNTIME_API_EXTERN bool
1220+
wasm_runtime_detect_native_stack_overflow(WASMExecEnv *exec_env);
1221+
1222+
WASM_RUNTIME_API_EXTERN bool
1223+
wasm_runtime_detect_native_stack_overflow_size(WASMExecEnv *exec_env,
1224+
uint32 requested_size);
12191225

12201226
#if WASM_ENABLE_LINUX_PERF != 0
12211227
bool

core/iwasm/compilation/aot_compiler.c

-4
Original file line numberDiff line numberDiff line change
@@ -487,10 +487,6 @@ fake_aot_gen_commit_value(AOTCompFrame *frame, bool reset_dirty_bit,
487487
case VALUE_TYPE_FUNCREF:
488488
case VALUE_TYPE_EXTERNREF:
489489
break;
490-
break;
491-
492-
break;
493-
494490
case VALUE_TYPE_I64:
495491
if (reset_dirty_bit)
496492
((*p) + 1)->dirty = 0;

core/iwasm/include/wasm_export.h

+7-33
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,6 @@ wasm_runtime_set_wasi_ns_lookup_pool(wasm_module_t module,
611611
*/
612612
WASM_RUNTIME_API_EXTERN wasm_module_inst_t
613613
wasm_runtime_instantiate(const wasm_module_t module,
614-
<<<<<<< HEAD
615614
uint32_t default_stack_size,
616615
uint32_t host_managed_heap_size, char *error_buf,
617616
uint32_t error_buf_size);
@@ -626,14 +625,6 @@ WASM_RUNTIME_API_EXTERN wasm_module_inst_t
626625
wasm_runtime_instantiate_ex(const wasm_module_t module,
627626
const InstantiationArgs *args, char *error_buf,
628627
uint32_t error_buf_size);
629-
||||||| parent of d8948a72 (Update version number to 2.0.0 and update release notes (#3327))
630-
uint32_t default_stack_size, uint32_t host_managed_heap_size,
631-
char *error_buf, uint32_t error_buf_size);
632-
=======
633-
uint32_t default_stack_size,
634-
uint32_t host_managed_heap_size, char *error_buf,
635-
uint32_t error_buf_size);
636-
>>>>>>> d8948a72 (Update version number to 2.0.0 and update release notes (#3327))
637628

638629
/**
639630
* Instantiate a WASM module, with specified instantiation arguments
@@ -649,12 +640,13 @@ wasm_runtime_instantiate_ex(const wasm_module_t module,
649640
/**
650641
* Instantiate a WASM module, with specified instantiation arguments
651642
*
652-
* Same as wasm_runtime_instantiate, but it also allows overwriting maximum memory
643+
* Same as wasm_runtime_instantiate, but it also allows overwriting maximum
644+
* memory
653645
*/
654646
WASM_RUNTIME_API_EXTERN wasm_module_inst_t
655647
wasm_runtime_instantiate_ex(const wasm_module_t module,
656-
const InstantiationArgs *args,
657-
char *error_buf, uint32_t error_buf_size);
648+
const InstantiationArgs *args, char *error_buf,
649+
uint32_t error_buf_size);
658650

659651
/**
660652
* Set the running mode of a WASM module instance, override the
@@ -1531,16 +1523,8 @@ WASM_RUNTIME_API_EXTERN double
15311523
wasm_runtime_sum_wasm_exec_time(wasm_module_inst_t module_inst);
15321524

15331525
/**
1534-
<<<<<<< HEAD
15351526
* Return execution time in ms of a given wasm function with
15361527
* func_name. If the function is not found, return 0.
1537-
||||||| parent of d8948a72 (Update version number to 2.0.0 and update release notes (#3327))
1538-
* Return execution time in ms of a given wasm funciton with
1539-
* func_name. If the function is not found, return 0.
1540-
=======
1541-
* Return execution time in ms of a given wasm funciton with
1542-
* func_name. If the function is not found, return 0.
1543-
>>>>>>> d8948a72 (Update version number to 2.0.0 and update release notes (#3327))
15441528
*
15451529
* @param module_inst the WASM module instance to profile
15461530
* @param func_name could be an export name or a name in the
@@ -1762,16 +1746,8 @@ wasm_runtime_is_import_func_linked(const char *module_name,
17621746
const char *func_name);
17631747

17641748
/**
1765-
<<<<<<< HEAD
17661749
* Check whether an import global `(import <module_name> <global_name>
17671750
* (global ...))` is linked or not with runtime registered native globals
1768-
||||||| parent of d8948a72 (Update version number to 2.0.0 and update release notes (#3327))
1769-
* Check whether an import global `(import <module_name> <global_name> (global ...))`
1770-
* is linked or not with runtime registered natvie globals
1771-
=======
1772-
* Check whether an import global `(import <module_name> <global_name>
1773-
* (global ...))` is linked or not with runtime registered natvie globals
1774-
>>>>>>> d8948a72 (Update version number to 2.0.0 and update release notes (#3327))
17751751
*/
17761752
WASM_RUNTIME_API_EXTERN bool
17771753
wasm_runtime_is_import_global_linked(const char *module_name,
@@ -1980,7 +1956,7 @@ wasm_runtime_is_underlying_binary_freeable(const wasm_module_t module);
19801956
/*
19811957
* wasm_runtime_checkpoint/wasm_runtime_restore
19821958
*
1983-
* These APIs are intended to be used by the host to register the current
1959+
* These APIs are intended to be used by the host to register the current
19841960
* state of the WASM module instance to a file and restore the state from
19851961
* file
19861962
* eg.
@@ -1993,11 +1969,9 @@ wasm_runtime_is_underlying_binary_freeable(const wasm_module_t module);
19931969
* }
19941970
*/
19951971
WASM_RUNTIME_API_EXTERN bool
1996-
wasm_runtime_checkpoint(wasm_module_inst_t module_inst,
1997-
char *file);
1972+
wasm_runtime_checkpoint(wasm_module_inst_t module_inst, char *file);
19981973
WASM_RUNTIME_API_EXTERN bool
1999-
wasm_runtime_restore(wasm_module_inst_t module_inst,
2000-
char *file, char *file1);
1974+
wasm_runtime_restore(wasm_module_inst_t module_inst, char *file, char *file1);
20011975
#endif
20021976

20031977
WASM_RUNTIME_API_EXTERN bool

core/iwasm/interpreter/wasm_mini_loader.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4269,7 +4269,7 @@ wasm_loader_pop_frame_ref(WASMLoaderContext *ctx, uint8 type, char *error_buf,
42694269
ctx->frame_ref--;
42704270
ctx->stack_cell_num--;
42714271

4272-
if (is_32bit_type(type) || *ctx->frame_ref == VALUE_TYPE_ANY)
4272+
if (is_32bit_type(type))
42734273
return true;
42744274

42754275
ctx->frame_ref--;

core/iwasm/libraries/libc-wasi/libc_wasi_wrapper.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2595,7 +2595,7 @@ wasi_sock_recv(wasm_exec_env_t exec_env, wasi_fd_t sock, iovec_app_t *ri_data,
25952595
ro_flags);
25962596
set_tcp();
25972597
#endif
2598-
if (!validate_native_addr(ro_flags, (uint32)sizeof(wasi_roflags_t)))
2598+
if (!validate_native_addr(ro_flags, (uint64)sizeof(wasi_roflags_t)))
25992599
return __WASI_EINVAL;
26002600

26012601
error = wasi_sock_recv_from(exec_env, sock, ri_data, ri_data_len, ri_flags,

0 commit comments

Comments
 (0)