aot_runtime.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #ifndef _AOT_RUNTIME_H_
  6. #define _AOT_RUNTIME_H_
  7. #include "bh_platform.h"
  8. #include "../common/wasm_runtime_common.h"
  9. #include "../interpreter/wasm_runtime.h"
  10. #include "../compilation/aot.h"
  11. #if WASM_ENABLE_JIT != 0
  12. #include "../compilation/aot_llvm.h"
  13. #endif
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. typedef enum AOTExceptionID {
  18. EXCE_UNREACHABLE = 0,
  19. EXCE_OUT_OF_MEMORY,
  20. EXCE_OUT_OF_BOUNDS_MEMORY_ACCESS,
  21. EXCE_INTEGER_OVERFLOW,
  22. EXCE_INTEGER_DIVIDE_BY_ZERO,
  23. EXCE_INVALID_CONVERSION_TO_INTEGER,
  24. EXCE_INVALID_FUNCTION_TYPE_INDEX,
  25. EXCE_INVALID_FUNCTION_INDEX,
  26. EXCE_UNDEFINED_ELEMENT,
  27. EXCE_UNINITIALIZED_ELEMENT,
  28. EXCE_CALL_UNLINKED_IMPORT_FUNC,
  29. EXCE_NATIVE_STACK_OVERFLOW,
  30. EXCE_UNALIGNED_ATOMIC,
  31. EXCE_AUX_STACK_OVERFLOW,
  32. EXCE_AUX_STACK_UNDERFLOW,
  33. EXCE_OUT_OF_BOUNDS_TABLE_ACCESS,
  34. EXCE_NUM,
  35. } AOTExceptionID;
  36. typedef enum AOTSectionType {
  37. AOT_SECTION_TYPE_TARGET_INFO = 0,
  38. AOT_SECTION_TYPE_INIT_DATA,
  39. AOT_SECTION_TYPE_TEXT,
  40. AOT_SECTION_TYPE_FUNCTION,
  41. AOT_SECTION_TYPE_EXPORT,
  42. AOT_SECTION_TYPE_RELOCATION,
  43. AOT_SECTION_TYPE_SIGANATURE
  44. } AOTSectionType;
  45. typedef struct AOTObjectDataSection {
  46. char *name;
  47. uint8 *data;
  48. uint32 size;
  49. } AOTObjectDataSection;
  50. /* Relocation info */
  51. typedef struct AOTRelocation {
  52. uint64 relocation_offset;
  53. uint64 relocation_addend;
  54. uint32 relocation_type;
  55. char *symbol_name;
  56. /* index in the symbol offset field */
  57. uint32 symbol_index;
  58. } AOTRelocation;
  59. /* Relocation Group */
  60. typedef struct AOTRelocationGroup {
  61. char *section_name;
  62. /* index in the symbol offset field */
  63. uint32 name_index;
  64. uint32 relocation_count;
  65. AOTRelocation *relocations;
  66. } AOTRelocationGroup;
  67. /* AOT function instance */
  68. typedef struct AOTFunctionInstance {
  69. char *func_name;
  70. uint32 func_index;
  71. bool is_import_func;
  72. union {
  73. struct {
  74. AOTFuncType *func_type;
  75. /* function pointer linked */
  76. void *func_ptr;
  77. } func;
  78. AOTImportFunc *func_import;
  79. } u;
  80. } AOTFunctionInstance;
  81. #if defined(OS_ENABLE_HW_BOUND_CHECK) && defined(BH_PLATFORM_WINDOWS)
  82. typedef struct AOTUnwindInfo {
  83. uint8 Version : 3;
  84. uint8 Flags : 5;
  85. uint8 SizeOfProlog;
  86. uint8 CountOfCodes;
  87. uint8 FrameRegister : 4;
  88. uint8 FrameOffset : 4;
  89. struct {
  90. struct {
  91. uint8 CodeOffset;
  92. uint8 UnwindOp : 4;
  93. uint8 OpInfo : 4;
  94. };
  95. uint16 FrameOffset;
  96. } UnwindCode[1];
  97. } AOTUnwindInfo;
  98. /* size of mov instruction and jmp instruction */
  99. #define PLT_ITEM_SIZE 12
  100. #endif
  101. typedef struct AOTModule {
  102. uint32 module_type;
  103. /* import memories */
  104. uint32 import_memory_count;
  105. AOTImportMemory *import_memories;
  106. /* memory info */
  107. uint32 memory_count;
  108. AOTMemory *memories;
  109. /* init data */
  110. uint32 mem_init_data_count;
  111. AOTMemInitData **mem_init_data_list;
  112. /* import tables */
  113. uint32 import_table_count;
  114. AOTImportTable *import_tables;
  115. /* tables */
  116. uint32 table_count;
  117. AOTTable *tables;
  118. /* table init data info */
  119. uint32 table_init_data_count;
  120. AOTTableInitData **table_init_data_list;
  121. /* function type info */
  122. uint32 func_type_count;
  123. AOTFuncType **func_types;
  124. /* import global varaible info */
  125. uint32 import_global_count;
  126. AOTImportGlobal *import_globals;
  127. /* global variable info */
  128. uint32 global_count;
  129. AOTGlobal *globals;
  130. /* total global variable size */
  131. uint32 global_data_size;
  132. /* import function info */
  133. uint32 import_func_count;
  134. AOTImportFunc *import_funcs;
  135. /* function info */
  136. uint32 func_count;
  137. /* point to AOTed/JITed functions */
  138. void **func_ptrs;
  139. /* function type indexes */
  140. uint32 *func_type_indexes;
  141. /* export info */
  142. uint32 export_count;
  143. AOTExport *exports;
  144. /* start function index, -1 denotes no start function */
  145. uint32 start_func_index;
  146. /* start function, point to AOTed/JITed function */
  147. void *start_function;
  148. uint32 malloc_func_index;
  149. uint32 free_func_index;
  150. uint32 retain_func_index;
  151. /* AOTed code, NULL for JIT mode */
  152. void *code;
  153. uint32 code_size;
  154. /* literal for AOTed code, NULL for JIT mode */
  155. uint8 *literal;
  156. uint32 literal_size;
  157. #if (defined(BUILD_TARGET_X86_64) || defined(BUILD_TARGET_AMD_64)) \
  158. && defined(BH_PLATFORM_WINDOWS)
  159. /* extra plt data area for __xmm and __real constants
  160. in Windows platform, NULL for JIT mode */
  161. uint8 *extra_plt_data;
  162. uint32 extra_plt_data_size;
  163. uint32 xmm_plt_count;
  164. uint32 real_plt_count;
  165. uint32 float_plt_count;
  166. #endif
  167. #if defined(OS_ENABLE_HW_BOUND_CHECK) && defined(BH_PLATFORM_WINDOWS)
  168. /* dynamic function table to be added by RtlAddFunctionTable(),
  169. used to unwind the call stack and register exception handler
  170. for AOT functions */
  171. RUNTIME_FUNCTION *rtl_func_table;
  172. bool rtl_func_table_registered;
  173. #endif
  174. /* data sections in AOT object file, including .data, .rodata
  175. * and .rodata.cstN. NULL for JIT mode. */
  176. AOTObjectDataSection *data_sections;
  177. uint32 data_section_count;
  178. /* constant string set */
  179. HashMap *const_str_set;
  180. /* the index of auxiliary __data_end global,
  181. -1 means unexported */
  182. uint32 aux_data_end_global_index;
  183. /* auxiliary __data_end exported by wasm app */
  184. uint32 aux_data_end;
  185. /* the index of auxiliary __heap_base global,
  186. -1 means unexported */
  187. uint32 aux_heap_base_global_index;
  188. /* auxiliary __heap_base exported by wasm app */
  189. uint32 aux_heap_base;
  190. /* the index of auxiliary stack top global,
  191. -1 means unexported */
  192. uint32 aux_stack_top_global_index;
  193. /* auxiliary stack bottom resolved */
  194. uint32 aux_stack_bottom;
  195. /* auxiliary stack size resolved */
  196. uint32 aux_stack_size;
  197. /* is jit mode or not */
  198. bool is_jit_mode;
  199. #if WASM_ENABLE_JIT != 0
  200. WASMModule *wasm_module;
  201. AOTCompContext *comp_ctx;
  202. AOTCompData *comp_data;
  203. #endif
  204. #if WASM_ENABLE_LIBC_WASI != 0
  205. WASIArguments wasi_args;
  206. bool is_wasi_module;
  207. #endif
  208. } AOTModule;
  209. typedef union {
  210. uint64 _make_it_8_bytes_;
  211. void *ptr;
  212. } AOTPointer;
  213. typedef union {
  214. uint64 u64;
  215. uint32 u32[2];
  216. } MemBound;
  217. typedef struct AOTMemoryInstance {
  218. uint32 module_type;
  219. /* shared memory flag */
  220. bool is_shared;
  221. /* memory space info */
  222. uint32 num_bytes_per_page;
  223. uint32 cur_page_count;
  224. uint32 max_page_count;
  225. uint32 memory_data_size;
  226. AOTPointer memory_data;
  227. AOTPointer memory_data_end;
  228. /* heap space info */
  229. AOTPointer heap_data;
  230. AOTPointer heap_data_end;
  231. AOTPointer heap_handle;
  232. /* boundary check constants for aot code */
  233. MemBound mem_bound_check_1byte;
  234. MemBound mem_bound_check_2bytes;
  235. MemBound mem_bound_check_4bytes;
  236. MemBound mem_bound_check_8bytes;
  237. MemBound mem_bound_check_16bytes;
  238. } AOTMemoryInstance;
  239. typedef struct AOTTableInstance {
  240. uint32 cur_size;
  241. /*
  242. * only grow in the range of [:max_size)
  243. * if the table is growable, max_size equals to its declared maximum size
  244. * otherwise, max_size equals to its declared minimum size
  245. */
  246. uint32 max_size;
  247. /*
  248. * +------------------------------+ <--- data
  249. * | ref.func[] or ref.extern[]
  250. * +------------------------------+
  251. */
  252. uint32 data[1];
  253. } AOTTableInstance;
  254. typedef struct AOTModuleInstance {
  255. uint32 module_type;
  256. /* memories */
  257. uint32 memory_count;
  258. AOTPointer memories;
  259. /* global and table info */
  260. uint32 global_data_size;
  261. /*
  262. * the count of AOTTableInstance.
  263. * it includes imported tables and local tables.
  264. *
  265. * TODO: for now we treate imported table like a local table
  266. */
  267. uint32 table_count;
  268. /* points to global_data */
  269. AOTPointer global_data;
  270. /* points to AOTTableInstance[] */
  271. AOTPointer tables;
  272. /* funciton pointer array */
  273. AOTPointer func_ptrs;
  274. /* function type indexes */
  275. AOTPointer func_type_indexes;
  276. /* export info */
  277. uint32 export_func_count;
  278. uint32 export_global_count;
  279. uint32 export_mem_count;
  280. uint32 export_tab_count;
  281. AOTPointer export_funcs;
  282. AOTPointer export_globals;
  283. AOTPointer export_memories;
  284. AOTPointer export_tables;
  285. /* The exception buffer for current thread. */
  286. char cur_exception[128];
  287. /* The custom data that can be set/get by
  288. * wasm_runtime_set_custom_data/wasm_runtime_get_custom_data */
  289. AOTPointer custom_data;
  290. /* The AOT module */
  291. AOTPointer aot_module;
  292. /* WASI context */
  293. AOTPointer wasi_ctx;
  294. /* function performance profiling info list */
  295. AOTPointer func_perf_profilings;
  296. AOTPointer exec_env_singleton;
  297. /* others */
  298. uint32 temp_ret;
  299. uint32 llvm_stack;
  300. uint32 default_wasm_stack_size;
  301. uint32 _padding;
  302. /* store stacktrace information */
  303. AOTPointer frames;
  304. /* reserved */
  305. uint32 reserved[6];
  306. /*
  307. * +------------------------------+ <-- memories.ptr
  308. * | #0 AOTMemoryInstance
  309. * +------------------------------+ <-- global_data.ptr
  310. * | global data
  311. * +------------------------------+ <-- tables.ptr
  312. * | AOTTableInstance[table_count]
  313. * +------------------------------+
  314. */
  315. union {
  316. uint64 _make_it_8_byte_aligned_;
  317. AOTMemoryInstance memory_instances[1];
  318. uint8 bytes[1];
  319. } global_table_data;
  320. } AOTModuleInstance;
  321. /* Target info, read from ELF header of object file */
  322. typedef struct AOTTargetInfo {
  323. /* Binary type, elf32l/elf32b/elf64l/elf64b */
  324. uint16 bin_type;
  325. /* ABI type */
  326. uint16 abi_type;
  327. /* Object file type */
  328. uint16 e_type;
  329. /* Architecture */
  330. uint16 e_machine;
  331. /* Object file version */
  332. uint32 e_version;
  333. /* Processor-specific flags */
  334. uint32 e_flags;
  335. /* Reserved */
  336. uint32 reserved;
  337. /* Arch name */
  338. char arch[16];
  339. } AOTTargetInfo;
  340. typedef struct AOTFuncPerfProfInfo
  341. {
  342. /* total execution time */
  343. uint64 total_exec_time;
  344. /* total execution count */
  345. uint32 total_exec_cnt;
  346. } AOTFuncPerfProfInfo;
  347. /* AOT auxiliary call stack */
  348. typedef struct AOTFrame {
  349. struct AOTFrame *prev_frame;
  350. uint32 func_index;
  351. #if WASM_ENABLE_PERF_PROFILING != 0
  352. uint64 time_started;
  353. AOTFuncPerfProfInfo *func_perf_prof_info;
  354. #endif
  355. } AOTFrame;
  356. /**
  357. * Load a AOT module from aot file buffer
  358. * @param buf the byte buffer which contains the AOT file data
  359. * @param size the size of the buffer
  360. * @param error_buf output of the error info
  361. * @param error_buf_size the size of the error string
  362. *
  363. * @return return AOT module loaded, NULL if failed
  364. */
  365. AOTModule*
  366. aot_load_from_aot_file(const uint8 *buf, uint32 size,
  367. char *error_buf, uint32 error_buf_size);
  368. /**
  369. * Load a AOT module from a specified AOT section list.
  370. *
  371. * @param section_list the section list which contains each section data
  372. * @param error_buf output of the error info
  373. * @param error_buf_size the size of the error string
  374. *
  375. * @return return AOT module loaded, NULL if failed
  376. */
  377. AOTModule*
  378. aot_load_from_sections(AOTSection *section_list,
  379. char *error_buf, uint32 error_buf_size);
  380. #if WASM_ENABLE_JIT != 0
  381. /**
  382. * Convert WASM module to AOT module
  383. *
  384. * @param wasm_module the WASM module to convert
  385. * @param error_buf output of the error info
  386. * @param error_buf_size the size of the error string
  387. *
  388. * @return return AOT module loaded, NULL if failed
  389. */
  390. AOTModule*
  391. aot_convert_wasm_module(WASMModule *wasm_module,
  392. char *error_buf, uint32 error_buf_size);
  393. #endif
  394. /**
  395. * Unload a AOT module.
  396. *
  397. * @param module the module to be unloaded
  398. */
  399. void
  400. aot_unload(AOTModule *module);
  401. /**
  402. * Instantiate a AOT module.
  403. *
  404. * @param module the AOT module to instantiate
  405. * @param is_sub_inst the flag of sub instance
  406. * @param heap_size the default heap size of the module instance, a heap will
  407. * be created besides the app memory space. Both wasm app and native
  408. * function can allocate memory from the heap. If heap_size is 0, the
  409. * default heap size will be used.
  410. * @param error_buf buffer to output the error info if failed
  411. * @param error_buf_size the size of the error buffer
  412. *
  413. * @return return the instantiated AOT module instance, NULL if failed
  414. */
  415. AOTModuleInstance*
  416. aot_instantiate(AOTModule *module, bool is_sub_inst,
  417. uint32 stack_size, uint32 heap_size,
  418. char *error_buf, uint32 error_buf_size);
  419. /**
  420. * Deinstantiate a AOT module instance, destroy the resources.
  421. *
  422. * @param module_inst the AOT module instance to destroy
  423. * @param is_sub_inst the flag of sub instance
  424. */
  425. void
  426. aot_deinstantiate(AOTModuleInstance *module_inst, bool is_sub_inst);
  427. /**
  428. * Lookup an exported function in the AOT module instance.
  429. *
  430. * @param module_inst the module instance
  431. * @param name the name of the function
  432. * @param signature the signature of the function, use "i32"/"i64"/"f32"/"f64"
  433. * to represent the type of i32/i64/f32/f64, e.g. "(i32i64)" "(i32)f32"
  434. *
  435. * @return the function instance found
  436. */
  437. AOTFunctionInstance*
  438. aot_lookup_function(const AOTModuleInstance *module_inst,
  439. const char *name, const char *signature);
  440. /**
  441. * Call the given AOT function of a AOT module instance with
  442. * arguments.
  443. *
  444. * @param exec_env the execution environment
  445. * @param function the function to be called
  446. * @param argc the number of arguments
  447. * @param argv the arguments. If the function method has return value,
  448. * the first (or first two in case 64-bit return value) element of
  449. * argv stores the return value of the called AOT function after this
  450. * function returns.
  451. *
  452. * @return true if success, false otherwise and exception will be thrown,
  453. * the caller can call aot_get_exception to get exception info.
  454. */
  455. bool
  456. aot_call_function(WASMExecEnv *exec_env,
  457. AOTFunctionInstance *function,
  458. unsigned argc, uint32 argv[]);
  459. bool
  460. aot_create_exec_env_and_call_function(AOTModuleInstance *module_inst,
  461. AOTFunctionInstance *function,
  462. unsigned argc, uint32 argv[]);
  463. bool
  464. aot_create_exec_env_singleton(AOTModuleInstance *module_inst);
  465. /**
  466. * Set AOT module instance exception with exception string
  467. *
  468. * @param module the AOT module instance
  469. *
  470. * @param exception current exception string
  471. */
  472. void
  473. aot_set_exception(AOTModuleInstance *module_inst,
  474. const char *exception);
  475. void
  476. aot_set_exception_with_id(AOTModuleInstance *module_inst,
  477. uint32 id);
  478. /**
  479. * Get exception info of the AOT module instance.
  480. *
  481. * @param module_inst the AOT module instance
  482. *
  483. * @return the exception string
  484. */
  485. const char*
  486. aot_get_exception(AOTModuleInstance *module_inst);
  487. /**
  488. * Clear exception info of the AOT module instance.
  489. *
  490. * @param module_inst the AOT module instance
  491. */
  492. void
  493. aot_clear_exception(AOTModuleInstance *module_inst);
  494. uint32
  495. aot_module_malloc(AOTModuleInstance *module_inst, uint32 size,
  496. void **p_native_addr);
  497. uint32
  498. aot_module_realloc(AOTModuleInstance *module_inst, uint32 ptr,
  499. uint32 size, void **p_native_addr);
  500. void
  501. aot_module_free(AOTModuleInstance *module_inst, uint32 ptr);
  502. uint32
  503. aot_module_dup_data(AOTModuleInstance *module_inst,
  504. const char *src, uint32 size);
  505. bool
  506. aot_validate_app_addr(AOTModuleInstance *module_inst,
  507. uint32 app_offset, uint32 size);
  508. bool
  509. aot_validate_native_addr(AOTModuleInstance *module_inst,
  510. void *native_ptr, uint32 size);
  511. void *
  512. aot_addr_app_to_native(AOTModuleInstance *module_inst, uint32 app_offset);
  513. uint32
  514. aot_addr_native_to_app(AOTModuleInstance *module_inst, void *native_ptr);
  515. bool
  516. aot_get_app_addr_range(AOTModuleInstance *module_inst,
  517. uint32 app_offset,
  518. uint32 *p_app_start_offset,
  519. uint32 *p_app_end_offset);
  520. bool
  521. aot_get_native_addr_range(AOTModuleInstance *module_inst,
  522. uint8 *native_ptr,
  523. uint8 **p_native_start_addr,
  524. uint8 **p_native_end_addr);
  525. bool
  526. aot_enlarge_memory(AOTModuleInstance *module_inst, uint32 inc_page_count);
  527. /**
  528. * Compare whether two wasm types are equal according to the indexs
  529. *
  530. * @param module_inst the AOT module instance
  531. * @param type1_idx index of the first wasm type
  532. * @param type2_idx index of the second wasm type
  533. *
  534. * @return true if equal, false otherwise
  535. */
  536. bool
  537. aot_is_wasm_type_equal(AOTModuleInstance *module_inst,
  538. uint32 type1_idx, uint32 type2_idx);
  539. /**
  540. * Invoke native function from aot code
  541. */
  542. bool
  543. aot_invoke_native(WASMExecEnv *exec_env, uint32 func_idx,
  544. uint32 argc, uint32 *argv);
  545. bool
  546. aot_call_indirect(WASMExecEnv *exec_env,
  547. uint32 tbl_idx, uint32 table_elem_idx,
  548. uint32 argc, uint32 *argv);
  549. uint32
  550. aot_get_plt_table_size();
  551. void *
  552. aot_memmove(void *dest, const void *src, size_t n);
  553. void *
  554. aot_memset(void *s, int c, size_t n);
  555. #if WASM_ENABLE_BULK_MEMORY != 0
  556. bool
  557. aot_memory_init(AOTModuleInstance *module_inst, uint32 seg_index,
  558. uint32 offset, uint32 len, uint32 dst);
  559. bool
  560. aot_data_drop(AOTModuleInstance *module_inst, uint32 seg_index);
  561. #endif
  562. #if WASM_ENABLE_THREAD_MGR != 0
  563. bool
  564. aot_set_aux_stack(WASMExecEnv *exec_env,
  565. uint32 start_offset, uint32 size);
  566. bool
  567. aot_get_aux_stack(WASMExecEnv *exec_env,
  568. uint32 *start_offset, uint32 *size);
  569. #endif
  570. #ifdef OS_ENABLE_HW_BOUND_CHECK
  571. bool
  572. aot_signal_init();
  573. void
  574. aot_signal_destroy();
  575. #endif
  576. void
  577. aot_get_module_mem_consumption(const AOTModule *module,
  578. WASMModuleMemConsumption *mem_conspn);
  579. void
  580. aot_get_module_inst_mem_consumption(const AOTModuleInstance *module_inst,
  581. WASMModuleInstMemConsumption *mem_conspn);
  582. #if WASM_ENABLE_REF_TYPES != 0
  583. void
  584. aot_drop_table_seg(AOTModuleInstance *module_inst, uint32 tbl_seg_idx);
  585. void
  586. aot_table_init(AOTModuleInstance *module_inst,
  587. uint32 tbl_idx, uint32 tbl_seg_idx,
  588. uint32 length, uint32 src_offset, uint32 dst_offset);
  589. void
  590. aot_table_copy(AOTModuleInstance *module_inst,
  591. uint32 src_tbl_idx, uint32 dst_tbl_idx,
  592. uint32 length, uint32 src_offset, uint32 dst_offset);
  593. void
  594. aot_table_fill(AOTModuleInstance *module_inst, uint32 tbl_idx,
  595. uint32 length, uint32 val, uint32 data_offset);
  596. uint32
  597. aot_table_grow(AOTModuleInstance *module_inst, uint32 tbl_idx,
  598. uint32 inc_entries, uint32 init_val);
  599. #endif
  600. AOTTableInstance *
  601. aot_next_tbl_inst(const AOTTableInstance *tbl_inst);
  602. bool
  603. aot_alloc_frame(WASMExecEnv *exec_env, uint32 func_index);
  604. void
  605. aot_free_frame(WASMExecEnv *exec_env);
  606. void
  607. aot_dump_call_stack(WASMExecEnv *exec_env);
  608. void
  609. aot_dump_perf_profiling(const AOTModuleInstance *module_inst);
  610. #ifdef __cplusplus
  611. } /* end of extern "C" */
  612. #endif
  613. #endif /* end of _AOT_RUNTIME_H_ */