Implement interpreter hw bound check (#1309)

Implement boundary check with hardware trap for interpreter on
64-bit platforms:
- To improve the performance of interpreter and Fast JIT
- To prepare for multi-tier compilation for the feature

Linux/MacOS/Windows 64-bit are enabled.
This commit is contained in:
Wenyong Huang
2022-07-22 11:05:40 +08:00
committed by GitHub
parent 32c94161d1
commit fd5030e02e
8 changed files with 591 additions and 101 deletions

View File

@ -407,6 +407,26 @@ typedef struct wasm_frame_t {
const char *func_name_wp;
} WASMCApiFrame;
#ifdef OS_ENABLE_HW_BOUND_CHECK
/* Signal info passing to interp/aot signal handler */
typedef struct WASMSignalInfo {
WASMExecEnv *exec_env_tls;
#ifndef BH_PLATFORM_WINDOWS
void *sig_addr;
#else
EXCEPTION_POINTERS *exce_info;
#endif
} WASMSignalInfo;
/* Set exec_env of thread local storage */
void
wasm_runtime_set_exec_env_tls(WASMExecEnv *exec_env);
/* Get exec_env of thread local storage */
WASMExecEnv *
wasm_runtime_get_exec_env_tls(void);
#endif
/* See wasm_export.h for description */
WASM_RUNTIME_API_EXTERN bool
wasm_runtime_init(void);