wasm_runtime.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #ifndef _WASM_RUNTIME_H
  6. #define _WASM_RUNTIME_H
  7. #include "wasm.h"
  8. #include "bh_hashmap.h"
  9. #include "../common/wasm_runtime_common.h"
  10. #include "../common/wasm_exec_env.h"
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. typedef struct WASMModuleInstance WASMModuleInstance;
  15. typedef struct WASMFunctionInstance WASMFunctionInstance;
  16. typedef struct WASMMemoryInstance WASMMemoryInstance;
  17. typedef struct WASMTableInstance WASMTableInstance;
  18. typedef struct WASMGlobalInstance WASMGlobalInstance;
  19. /**
  20. * When LLVM JIT, WAMR compiler or AOT is enabled, we should ensure that
  21. * some offsets of the same field in the interpreter module instance and
  22. * aot module instance are the same, so that the LLVM JITed/AOTed code
  23. * can smoothly access the interpreter module instance.
  24. * Same for the memory instance and table instance.
  25. * We use the macro DefPointer to define some related pointer fields.
  26. */
  27. #if (WASM_ENABLE_JIT != 0 || WASM_ENABLE_WAMR_COMPILER != 0 \
  28. || WASM_ENABLE_AOT != 0) \
  29. && UINTPTR_MAX == UINT32_MAX
  30. /* Add u32 padding if LLVM JIT, WAMR compiler or AOT is enabled on
  31. 32-bit platform */
  32. #define DefPointer(type, field) \
  33. type field; \
  34. uint32 field##_padding
  35. #else
  36. #define DefPointer(type, field) type field
  37. #endif
  38. typedef enum WASMExceptionID {
  39. EXCE_UNREACHABLE = 0,
  40. EXCE_OUT_OF_MEMORY,
  41. EXCE_OUT_OF_BOUNDS_MEMORY_ACCESS,
  42. EXCE_INTEGER_OVERFLOW,
  43. EXCE_INTEGER_DIVIDE_BY_ZERO,
  44. EXCE_INVALID_CONVERSION_TO_INTEGER,
  45. EXCE_INVALID_FUNCTION_TYPE_INDEX,
  46. EXCE_INVALID_FUNCTION_INDEX,
  47. EXCE_UNDEFINED_ELEMENT,
  48. EXCE_UNINITIALIZED_ELEMENT,
  49. EXCE_CALL_UNLINKED_IMPORT_FUNC,
  50. EXCE_NATIVE_STACK_OVERFLOW,
  51. EXCE_UNALIGNED_ATOMIC,
  52. EXCE_AUX_STACK_OVERFLOW,
  53. EXCE_AUX_STACK_UNDERFLOW,
  54. EXCE_OUT_OF_BOUNDS_TABLE_ACCESS,
  55. EXCE_OPERAND_STACK_OVERFLOW,
  56. EXCE_ALREADY_THROWN,
  57. EXCE_NUM,
  58. } WASMExceptionID;
  59. typedef union {
  60. uint64 u64;
  61. uint32 u32[2];
  62. } MemBound;
  63. struct WASMMemoryInstance {
  64. /* Module type */
  65. uint32 module_type;
  66. /* Shared memory flag */
  67. bool is_shared;
  68. /* Number bytes per page */
  69. uint32 num_bytes_per_page;
  70. /* Current page count */
  71. uint32 cur_page_count;
  72. /* Maximum page count */
  73. uint32 max_page_count;
  74. /* Memory data size */
  75. uint32 memory_data_size;
  76. /**
  77. * Memory data begin address, Note:
  78. * the app-heap might be inserted in to the linear memory,
  79. * when memory is re-allocated, the heap data and memory data
  80. * must be copied to new memory also
  81. */
  82. DefPointer(uint8 *, memory_data);
  83. /* Memory data end address */
  84. DefPointer(uint8 *, memory_data_end);
  85. /* Heap data base address */
  86. DefPointer(uint8 *, heap_data);
  87. /* Heap data end address */
  88. DefPointer(uint8 *, heap_data_end);
  89. /* The heap created */
  90. DefPointer(void *, heap_handle);
  91. #if WASM_ENABLE_FAST_JIT != 0 || WASM_ENABLE_JIT != 0 \
  92. || WASM_ENABLE_WAMR_COMPILER != 0 || WASM_ENABLE_AOT != 0
  93. MemBound mem_bound_check_1byte;
  94. MemBound mem_bound_check_2bytes;
  95. MemBound mem_bound_check_4bytes;
  96. MemBound mem_bound_check_8bytes;
  97. MemBound mem_bound_check_16bytes;
  98. #endif
  99. };
  100. struct WASMTableInstance {
  101. /* Current size */
  102. uint32 cur_size;
  103. /* Maximum size */
  104. uint32 max_size;
  105. /* Table elements */
  106. uint32 elems[1];
  107. };
  108. struct WASMGlobalInstance {
  109. /* value type, VALUE_TYPE_I32/I64/F32/F64 */
  110. uint8 type;
  111. /* mutable or constant */
  112. bool is_mutable;
  113. /* data offset to base_addr of WASMMemoryInstance */
  114. uint32 data_offset;
  115. /* initial value */
  116. WASMValue initial_value;
  117. #if WASM_ENABLE_MULTI_MODULE != 0
  118. /* just for import, keep the reference here */
  119. WASMModuleInstance *import_module_inst;
  120. WASMGlobalInstance *import_global_inst;
  121. #endif
  122. };
  123. struct WASMFunctionInstance {
  124. /* whether it is import function or WASM function */
  125. bool is_import_func;
  126. /* parameter count */
  127. uint16 param_count;
  128. /* local variable count, 0 for import function */
  129. uint16 local_count;
  130. /* cell num of parameters */
  131. uint16 param_cell_num;
  132. /* cell num of return type */
  133. uint16 ret_cell_num;
  134. /* cell num of local variables, 0 for import function */
  135. uint16 local_cell_num;
  136. #if WASM_ENABLE_FAST_INTERP != 0
  137. /* cell num of consts */
  138. uint16 const_cell_num;
  139. #endif
  140. uint16 *local_offsets;
  141. /* parameter types */
  142. uint8 *param_types;
  143. /* local types, NULL for import function */
  144. uint8 *local_types;
  145. union {
  146. WASMFunctionImport *func_import;
  147. WASMFunction *func;
  148. } u;
  149. #if WASM_ENABLE_MULTI_MODULE != 0
  150. WASMModuleInstance *import_module_inst;
  151. WASMFunctionInstance *import_func_inst;
  152. #endif
  153. #if WASM_ENABLE_PERF_PROFILING != 0
  154. /* total execution time */
  155. uint64 total_exec_time;
  156. /* total execution count */
  157. uint32 total_exec_cnt;
  158. #endif
  159. };
  160. typedef struct WASMExportFuncInstance {
  161. char *name;
  162. WASMFunctionInstance *function;
  163. } WASMExportFuncInstance;
  164. typedef struct WASMExportGlobInstance {
  165. char *name;
  166. WASMGlobalInstance *global;
  167. } WASMExportGlobInstance;
  168. typedef struct WASMExportTabInstance {
  169. char *name;
  170. WASMTableInstance *table;
  171. } WASMExportTabInstance;
  172. typedef struct WASMExportMemInstance {
  173. char *name;
  174. WASMMemoryInstance *memory;
  175. } WASMExportMemInstance;
  176. /* Extra info of WASM module instance for interpreter/jit mode */
  177. typedef struct WASMModuleInstanceExtra {
  178. WASMGlobalInstance *globals;
  179. WASMFunctionInstance *functions;
  180. uint32 global_count;
  181. uint32 function_count;
  182. WASMFunctionInstance *start_function;
  183. WASMFunctionInstance *malloc_function;
  184. WASMFunctionInstance *free_function;
  185. WASMFunctionInstance *retain_function;
  186. #if WASM_ENABLE_SHARED_MEMORY != 0
  187. /* lock for shared memory atomic operations */
  188. korp_mutex mem_lock;
  189. bool mem_lock_inited;
  190. #endif
  191. #if WASM_ENABLE_MULTI_MODULE != 0
  192. bh_list sub_module_inst_list_head;
  193. bh_list *sub_module_inst_list;
  194. /* linked table instances of import table instances */
  195. WASMTableInstance **table_insts_linked;
  196. #endif
  197. #if WASM_ENABLE_MEMORY_PROFILING != 0
  198. uint32 max_aux_stack_used;
  199. #endif
  200. } WASMModuleInstanceExtra;
  201. struct AOTFuncPerfProfInfo;
  202. struct WASMModuleInstance {
  203. /* Module instance type, for module instance loaded from
  204. WASM bytecode binary, this field is Wasm_Module_Bytecode;
  205. for module instance loaded from AOT file, this field is
  206. Wasm_Module_AoT, and this structure should be treated as
  207. AOTModuleInstance structure. */
  208. uint32 module_type;
  209. uint32 memory_count;
  210. DefPointer(WASMMemoryInstance **, memories);
  211. /* global and table info */
  212. uint32 global_data_size;
  213. uint32 table_count;
  214. DefPointer(uint8 *, global_data);
  215. /* For AOTModuleInstance, it denotes `AOTTableInstance *` */
  216. DefPointer(WASMTableInstance **, tables);
  217. /* import func ptrs + llvm jit func ptrs */
  218. DefPointer(void **, func_ptrs);
  219. /* function type indexes */
  220. DefPointer(uint32 *, func_type_indexes);
  221. uint32 export_func_count;
  222. uint32 export_global_count;
  223. uint32 export_memory_count;
  224. uint32 export_table_count;
  225. /* For AOTModuleInstance, it denotes `AOTFunctionInstance *` */
  226. DefPointer(WASMExportFuncInstance *, export_functions);
  227. DefPointer(WASMExportGlobInstance *, export_globals);
  228. DefPointer(WASMExportMemInstance *, export_memories);
  229. DefPointer(WASMExportTabInstance *, export_tables);
  230. /* The exception buffer of wasm interpreter for current thread. */
  231. char cur_exception[128];
  232. /* The WASM module or AOT module, for AOTModuleInstance,
  233. it denotes `AOTModule *` */
  234. DefPointer(WASMModule *, module);
  235. #if WASM_ENABLE_LIBC_WASI
  236. /* WASI context */
  237. DefPointer(WASIContext *, wasi_ctx);
  238. #else
  239. DefPointer(void *, wasi_ctx);
  240. #endif
  241. DefPointer(WASMExecEnv *, exec_env_singleton);
  242. /* Array of function pointers to import functions,
  243. not available in AOTModuleInstance */
  244. DefPointer(void **, import_func_ptrs);
  245. /* Array of function pointers to fast jit functions,
  246. not available in AOTModuleInstance */
  247. DefPointer(void **, fast_jit_func_ptrs);
  248. /* The custom data that can be set/get by wasm_{get|set}_custom_data */
  249. DefPointer(void *, custom_data);
  250. /* Stack frames, used in call stack dump and perf profiling */
  251. DefPointer(Vector *, frames);
  252. /* Function performance profiling info list, only available
  253. in AOTModuleInstance */
  254. DefPointer(struct AOTFuncPerfProfInfo *, func_perf_profilings);
  255. /* WASM/AOT module extra info, for AOTModuleInstance,
  256. it denotes `AOTModuleInstanceExtra *` */
  257. DefPointer(WASMModuleInstanceExtra *, e);
  258. /* Default WASM operand stack size */
  259. uint32 default_wasm_stack_size;
  260. uint32 reserved[3];
  261. /*
  262. * +------------------------------+ <-- memories
  263. * | WASMMemoryInstance[mem_count], mem_count is always 1 for LLVM JIT/AOT
  264. * +------------------------------+ <-- global_data
  265. * | global data
  266. * +------------------------------+ <-- tables
  267. * | WASMTableInstance[table_count]
  268. * +------------------------------+ <-- e
  269. * | WASMModuleInstanceExtra
  270. * +------------------------------+
  271. */
  272. union {
  273. uint64 _make_it_8_byte_aligned_;
  274. WASMMemoryInstance memory_instances[1];
  275. uint8 bytes[1];
  276. } global_table_data;
  277. };
  278. struct WASMInterpFrame;
  279. typedef struct WASMInterpFrame WASMRuntimeFrame;
  280. #if WASM_ENABLE_MULTI_MODULE != 0
  281. typedef struct WASMSubModInstNode {
  282. bh_list_link l;
  283. /* point to a string pool */
  284. const char *module_name;
  285. WASMModuleInstance *module_inst;
  286. } WASMSubModInstNode;
  287. #endif
  288. /**
  289. * Return the code block of a function.
  290. *
  291. * @param func the WASM function instance
  292. *
  293. * @return the code block of the function
  294. */
  295. static inline uint8 *
  296. wasm_get_func_code(WASMFunctionInstance *func)
  297. {
  298. #if WASM_ENABLE_FAST_INTERP == 0
  299. return func->is_import_func ? NULL : func->u.func->code;
  300. #else
  301. return func->is_import_func ? NULL : func->u.func->code_compiled;
  302. #endif
  303. }
  304. /**
  305. * Return the code block end of a function.
  306. *
  307. * @param func the WASM function instance
  308. *
  309. * @return the code block end of the function
  310. */
  311. static inline uint8 *
  312. wasm_get_func_code_end(WASMFunctionInstance *func)
  313. {
  314. #if WASM_ENABLE_FAST_INTERP == 0
  315. return func->is_import_func ? NULL
  316. : func->u.func->code + func->u.func->code_size;
  317. #else
  318. return func->is_import_func
  319. ? NULL
  320. : func->u.func->code_compiled + func->u.func->code_compiled_size;
  321. #endif
  322. }
  323. WASMModule *
  324. wasm_load(uint8 *buf, uint32 size, char *error_buf, uint32 error_buf_size);
  325. WASMModule *
  326. wasm_load_from_sections(WASMSection *section_list, char *error_buf,
  327. uint32 error_buf_size);
  328. void
  329. wasm_unload(WASMModule *module);
  330. WASMModuleInstance *
  331. wasm_instantiate(WASMModule *module, bool is_sub_inst, uint32 stack_size,
  332. uint32 heap_size, char *error_buf, uint32 error_buf_size);
  333. void
  334. wasm_dump_perf_profiling(const WASMModuleInstance *module_inst);
  335. void
  336. wasm_deinstantiate(WASMModuleInstance *module_inst, bool is_sub_inst);
  337. WASMFunctionInstance *
  338. wasm_lookup_function(const WASMModuleInstance *module_inst, const char *name,
  339. const char *signature);
  340. #if WASM_ENABLE_MULTI_MODULE != 0
  341. WASMGlobalInstance *
  342. wasm_lookup_global(const WASMModuleInstance *module_inst, const char *name);
  343. WASMMemoryInstance *
  344. wasm_lookup_memory(const WASMModuleInstance *module_inst, const char *name);
  345. WASMTableInstance *
  346. wasm_lookup_table(const WASMModuleInstance *module_inst, const char *name);
  347. #endif
  348. bool
  349. wasm_call_function(WASMExecEnv *exec_env, WASMFunctionInstance *function,
  350. unsigned argc, uint32 argv[]);
  351. bool
  352. wasm_create_exec_env_and_call_function(WASMModuleInstance *module_inst,
  353. WASMFunctionInstance *function,
  354. unsigned argc, uint32 argv[]);
  355. void
  356. wasm_set_exception(WASMModuleInstance *module, const char *exception);
  357. void
  358. wasm_set_exception_with_id(WASMModuleInstance *module_inst, uint32 id);
  359. const char *
  360. wasm_get_exception(WASMModuleInstance *module);
  361. uint32
  362. wasm_module_malloc(WASMModuleInstance *module_inst, uint32 size,
  363. void **p_native_addr);
  364. uint32
  365. wasm_module_realloc(WASMModuleInstance *module_inst, uint32 ptr, uint32 size,
  366. void **p_native_addr);
  367. void
  368. wasm_module_free(WASMModuleInstance *module_inst, uint32 ptr);
  369. uint32
  370. wasm_module_dup_data(WASMModuleInstance *module_inst, const char *src,
  371. uint32 size);
  372. /**
  373. * Check whether the app address and the buf is inside the linear memory,
  374. * and convert the app address into native address
  375. */
  376. bool
  377. wasm_check_app_addr_and_convert(WASMModuleInstance *module_inst, bool is_str,
  378. uint32 app_buf_addr, uint32 app_buf_size,
  379. void **p_native_addr);
  380. WASMMemoryInstance *
  381. wasm_get_default_memory(WASMModuleInstance *module_inst);
  382. bool
  383. wasm_enlarge_memory(WASMModuleInstance *module_inst, uint32 inc_page_count);
  384. bool
  385. wasm_call_indirect(WASMExecEnv *exec_env, uint32 tbl_idx, uint32 elem_idx,
  386. uint32 argc, uint32 argv[]);
  387. #if WASM_ENABLE_THREAD_MGR != 0
  388. bool
  389. wasm_set_aux_stack(WASMExecEnv *exec_env, uint32 start_offset, uint32 size);
  390. bool
  391. wasm_get_aux_stack(WASMExecEnv *exec_env, uint32 *start_offset, uint32 *size);
  392. #endif
  393. void
  394. wasm_get_module_mem_consumption(const WASMModule *module,
  395. WASMModuleMemConsumption *mem_conspn);
  396. void
  397. wasm_get_module_inst_mem_consumption(const WASMModuleInstance *module,
  398. WASMModuleInstMemConsumption *mem_conspn);
  399. #if WASM_ENABLE_REF_TYPES != 0
  400. static inline bool
  401. wasm_elem_is_active(uint32 mode)
  402. {
  403. return (mode & 0x1) == 0x0;
  404. }
  405. static inline bool
  406. wasm_elem_is_passive(uint32 mode)
  407. {
  408. return (mode & 0x1) == 0x1;
  409. }
  410. static inline bool
  411. wasm_elem_is_declarative(uint32 mode)
  412. {
  413. return (mode & 0x3) == 0x3;
  414. }
  415. bool
  416. wasm_enlarge_table(WASMModuleInstance *module_inst, uint32 table_idx,
  417. uint32 inc_entries, uint32 init_val);
  418. #endif /* WASM_ENABLE_REF_TYPES != 0 */
  419. static inline WASMTableInstance *
  420. wasm_get_table_inst(const WASMModuleInstance *module_inst, uint32 tbl_idx)
  421. {
  422. /* careful, it might be a table in another module */
  423. WASMTableInstance *tbl_inst = module_inst->tables[tbl_idx];
  424. #if WASM_ENABLE_MULTI_MODULE != 0
  425. if (tbl_idx < module_inst->module->import_table_count
  426. && module_inst->e->table_insts_linked[tbl_idx]) {
  427. tbl_inst = module_inst->e->table_insts_linked[tbl_idx];
  428. }
  429. #endif
  430. bh_assert(tbl_inst);
  431. return tbl_inst;
  432. }
  433. #if WASM_ENABLE_DUMP_CALL_STACK != 0
  434. bool
  435. wasm_interp_create_call_stack(struct WASMExecEnv *exec_env);
  436. /**
  437. * @brief Dump wasm call stack or get the size
  438. *
  439. * @param exec_env the execution environment
  440. * @param print whether to print to stdout or not
  441. * @param buf buffer to store the dumped content
  442. * @param len length of the buffer
  443. *
  444. * @return when print is true, return the bytes printed out to stdout; when
  445. * print is false and buf is NULL, return the size required to store the
  446. * callstack content; when print is false and buf is not NULL, return the size
  447. * dumped to the buffer, 0 means error and data in buf may be invalid
  448. */
  449. uint32
  450. wasm_interp_dump_call_stack(struct WASMExecEnv *exec_env, bool print, char *buf,
  451. uint32 len);
  452. #endif
  453. const uint8 *
  454. wasm_loader_get_custom_section(WASMModule *module, const char *name,
  455. uint32 *len);
  456. #if WASM_ENABLE_FAST_JIT != 0 || WASM_ENABLE_JIT != 0 \
  457. || WASM_ENABLE_WAMR_COMPILER != 0
  458. void
  459. jit_set_exception_with_id(WASMModuleInstance *module_inst, uint32 id);
  460. /**
  461. * Check whether the app address and the buf is inside the linear memory,
  462. * and convert the app address into native address
  463. */
  464. bool
  465. jit_check_app_addr_and_convert(WASMModuleInstance *module_inst, bool is_str,
  466. uint32 app_buf_addr, uint32 app_buf_size,
  467. void **p_native_addr);
  468. #endif /* end of WASM_ENABLE_FAST_JIT != 0 || WASM_ENABLE_JIT != 0 \
  469. || WASM_ENABLE_WAMR_COMPILER != 0 */
  470. #if WASM_ENABLE_FAST_JIT != 0
  471. bool
  472. fast_jit_call_indirect(WASMExecEnv *exec_env, uint32 tbl_idx, uint32 elem_idx,
  473. uint32 type_idx, uint32 argc, uint32 *argv);
  474. bool
  475. fast_jit_invoke_native(WASMExecEnv *exec_env, uint32 func_idx,
  476. struct WASMInterpFrame *prev_frame);
  477. #endif
  478. #if WASM_ENABLE_JIT != 0 || WASM_ENABLE_WAMR_COMPILER != 0
  479. bool
  480. llvm_jit_call_indirect(WASMExecEnv *exec_env, uint32 tbl_idx, uint32 elem_idx,
  481. uint32 argc, uint32 *argv);
  482. bool
  483. llvm_jit_invoke_native(WASMExecEnv *exec_env, uint32 func_idx, uint32 argc,
  484. uint32 *argv);
  485. #if WASM_ENABLE_BULK_MEMORY != 0
  486. bool
  487. llvm_jit_memory_init(WASMModuleInstance *module_inst, uint32 seg_index,
  488. uint32 offset, uint32 len, uint32 dst);
  489. bool
  490. llvm_jit_data_drop(WASMModuleInstance *module_inst, uint32 seg_index);
  491. #endif
  492. #if WASM_ENABLE_REF_TYPES != 0
  493. void
  494. llvm_jit_drop_table_seg(WASMModuleInstance *module_inst, uint32 tbl_seg_idx);
  495. void
  496. llvm_jit_table_init(WASMModuleInstance *module_inst, uint32 tbl_idx,
  497. uint32 tbl_seg_idx, uint32 length, uint32 src_offset,
  498. uint32 dst_offset);
  499. void
  500. llvm_jit_table_copy(WASMModuleInstance *module_inst, uint32 src_tbl_idx,
  501. uint32 dst_tbl_idx, uint32 length, uint32 src_offset,
  502. uint32 dst_offset);
  503. void
  504. llvm_jit_table_fill(WASMModuleInstance *module_inst, uint32 tbl_idx,
  505. uint32 length, uint32 val, uint32 data_offset);
  506. uint32
  507. llvm_jit_table_grow(WASMModuleInstance *module_inst, uint32 tbl_idx,
  508. uint32 inc_entries, uint32 init_val);
  509. #endif
  510. #if WASM_ENABLE_DUMP_CALL_STACK != 0 || WASM_ENABLE_PERF_PROFILING != 0
  511. bool
  512. llvm_jit_alloc_frame(WASMExecEnv *exec_env, uint32 func_index);
  513. void
  514. llvm_jit_free_frame(WASMExecEnv *exec_env);
  515. #endif
  516. #endif /* end of WASM_ENABLE_JIT != 0 || WASM_ENABLE_WAMR_COMPILER != 0 */
  517. #ifdef __cplusplus
  518. }
  519. #endif
  520. #endif /* end of _WASM_RUNTIME_H */