Skip to content

Commit 8f9892d

Browse files
authored
Merge some APIs of interp and AOT modes (#1509)
Refer to #1384. To unify the memory instantiate process for interpreter/AOT in the future.
1 parent 382357c commit 8f9892d

20 files changed

+829
-1596
lines changed

core/iwasm/aot/aot_runtime.c

Lines changed: 18 additions & 544 deletions
Large diffs are not rendered by default.

core/iwasm/aot/aot_runtime.h

Lines changed: 4 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,6 @@
1515
extern "C" {
1616
#endif
1717

18-
typedef enum AOTExceptionID {
19-
EXCE_UNREACHABLE = 0,
20-
EXCE_OUT_OF_MEMORY,
21-
EXCE_OUT_OF_BOUNDS_MEMORY_ACCESS,
22-
EXCE_INTEGER_OVERFLOW,
23-
EXCE_INTEGER_DIVIDE_BY_ZERO,
24-
EXCE_INVALID_CONVERSION_TO_INTEGER,
25-
EXCE_INVALID_FUNCTION_TYPE_INDEX,
26-
EXCE_INVALID_FUNCTION_INDEX,
27-
EXCE_UNDEFINED_ELEMENT,
28-
EXCE_UNINITIALIZED_ELEMENT,
29-
EXCE_CALL_UNLINKED_IMPORT_FUNC,
30-
EXCE_NATIVE_STACK_OVERFLOW,
31-
EXCE_UNALIGNED_ATOMIC,
32-
EXCE_AUX_STACK_OVERFLOW,
33-
EXCE_AUX_STACK_UNDERFLOW,
34-
EXCE_OUT_OF_BOUNDS_TABLE_ACCESS,
35-
EXCE_NUM,
36-
} AOTExceptionID;
37-
3818
typedef enum AOTSectionType {
3919
AOT_SECTION_TYPE_TARGET_INFO = 0,
4020
AOT_SECTION_TYPE_INIT_DATA = 1,
@@ -401,9 +381,6 @@ aot_create_exec_env_and_call_function(AOTModuleInstance *module_inst,
401381
AOTFunctionInstance *function,
402382
unsigned argc, uint32 argv[]);
403383

404-
bool
405-
aot_create_exec_env_singleton(AOTModuleInstance *module_inst);
406-
407384
/**
408385
* Set AOT module instance exception with exception string
409386
*
@@ -427,14 +404,6 @@ aot_set_exception_with_id(AOTModuleInstance *module_inst, uint32 id);
427404
const char *
428405
aot_get_exception(AOTModuleInstance *module_inst);
429406

430-
/**
431-
* Clear exception info of the AOT module instance.
432-
*
433-
* @param module_inst the AOT module instance
434-
*/
435-
void
436-
aot_clear_exception(AOTModuleInstance *module_inst);
437-
438407
uint32
439408
aot_module_malloc(AOTModuleInstance *module_inst, uint32 size,
440409
void **p_native_addr);
@@ -450,29 +419,6 @@ uint32
450419
aot_module_dup_data(AOTModuleInstance *module_inst, const char *src,
451420
uint32 size);
452421

453-
bool
454-
aot_validate_app_addr(AOTModuleInstance *module_inst, uint32 app_offset,
455-
uint32 size);
456-
457-
bool
458-
aot_validate_native_addr(AOTModuleInstance *module_inst, void *native_ptr,
459-
uint32 size);
460-
461-
void *
462-
aot_addr_app_to_native(AOTModuleInstance *module_inst, uint32 app_offset);
463-
464-
uint32
465-
aot_addr_native_to_app(AOTModuleInstance *module_inst, void *native_ptr);
466-
467-
bool
468-
aot_get_app_addr_range(AOTModuleInstance *module_inst, uint32 app_offset,
469-
uint32 *p_app_start_offset, uint32 *p_app_end_offset);
470-
471-
bool
472-
aot_get_native_addr_range(AOTModuleInstance *module_inst, uint8 *native_ptr,
473-
uint8 **p_native_start_addr,
474-
uint8 **p_native_end_addr);
475-
476422
bool
477423
aot_enlarge_memory(AOTModuleInstance *module_inst, uint32 inc_page_count);
478424

@@ -487,6 +433,10 @@ bool
487433
aot_call_indirect(WASMExecEnv *exec_env, uint32 tbl_idx, uint32 table_elem_idx,
488434
uint32 argc, uint32 *argv);
489435

436+
/**
437+
* Check whether the app address and the buf is inside the linear memory,
438+
* and convert the app address into native address
439+
*/
490440
bool
491441
aot_check_app_addr_and_convert(AOTModuleInstance *module_inst, bool is_str,
492442
uint32 app_buf_addr, uint32 app_buf_size,
@@ -518,16 +468,6 @@ bool
518468
aot_get_aux_stack(WASMExecEnv *exec_env, uint32 *start_offset, uint32 *size);
519469
#endif
520470

521-
#ifdef OS_ENABLE_HW_BOUND_CHECK
522-
#ifndef BH_PLATFORM_WINDOWS
523-
void
524-
aot_signal_handler(WASMSignalInfo *sig_info);
525-
#else
526-
LONG
527-
aot_exception_handler(WASMSignalInfo *sig_info);
528-
#endif
529-
#endif
530-
531471
void
532472
aot_get_module_mem_consumption(const AOTModule *module,
533473
WASMModuleMemConsumption *mem_conspn);

0 commit comments

Comments
 (0)