Skip to content

Commit

Permalink
Merge branch 'dev/checkpoint_and_restore' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
victoryang00 committed May 26, 2024
2 parents 2da0ccf + 2a630c9 commit 84cfce9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions core/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,8 @@
* - 4KB-17KB on macOS/amd64
* - 12KB on Ubuntu amd64 20.04
* - 0.3-1.5KB on NuttX/esp32s3
* libc snprintf (used by eg. wasm_runtime_set_exception) consumes about
* 1600 bytes stack on macOS/amd64, about 2000 bytes on Ubuntu amd64 20.04.
*
* - stack check wrapper functions generated by the aot compiler
* (--stack-bounds-checks=1)
Expand Down
6 changes: 6 additions & 0 deletions core/iwasm/common/wasm_runtime_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,12 @@ wasm_runtime_checkpoint(wasm_module_inst_t module_inst, char *file);
bool
wasm_runtime_restore(wasm_module_inst_t module_inst, char *file, char *file1);
#endif
WASM_RUNTIME_API_EXTERN bool
wasm_runtime_detect_native_stack_overflow(WASMExecEnv *exec_env);

WASM_RUNTIME_API_EXTERN bool
wasm_runtime_detect_native_stack_overflow_size(WASMExecEnv *exec_env,
uint32 requested_size);

#if WASM_ENABLE_LINUX_PERF != 0
bool
Expand Down
4 changes: 0 additions & 4 deletions core/iwasm/compilation/aot_compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,10 +471,6 @@ fake_aot_gen_commit_value(AOTCompFrame *frame, bool reset_dirty_bit,
case VALUE_TYPE_FUNCREF:
case VALUE_TYPE_EXTERNREF:
break;
break;

break;

case VALUE_TYPE_I64:
if (reset_dirty_bit)
((*p) + 1)->dirty = 0;
Expand Down
2 changes: 1 addition & 1 deletion core/iwasm/interpreter/wasm_mini_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -4240,7 +4240,7 @@ wasm_loader_pop_frame_ref(WASMLoaderContext *ctx, uint8 type, char *error_buf,
ctx->frame_ref--;
ctx->stack_cell_num--;

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

ctx->frame_ref--;
Expand Down
3 changes: 1 addition & 2 deletions core/iwasm/libraries/libc-wasi/libc_wasi_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -2594,8 +2594,7 @@ wasi_sock_recv(wasm_exec_env_t exec_env, wasi_fd_t sock, iovec_app_t *ri_data,
exec_env, sock, ri_data, ri_data_len, ri_flags, ro_data_len,
ro_flags);
set_tcp();
#endif
if (!validate_native_addr(ro_flags, (uint32)sizeof(wasi_roflags_t)))
if (!validate_native_addr(ro_flags, (uint64)sizeof(wasi_roflags_t)))
return __WASI_EINVAL;

error = wasi_sock_recv_from(exec_env, sock, ri_data, ri_data_len, ri_flags,
Expand Down

0 comments on commit 84cfce9

Please sign in to comment.