|
27 | 27 | #include "validation.h" |
28 | 28 | #include "xlog.h" |
29 | 29 |
|
| 30 | +/* |
| 31 | + * some of wasm instructions have one-byte prefix. |
| 32 | + * note: the prefix is just u8, NOT leb128. |
| 33 | + * |
| 34 | + * prefix our list of instructions |
| 35 | + * ------- ------------------------ |
| 36 | + * 0xfc insn_list_fc.h |
| 37 | + * 0xfd insn_list_simd.h |
| 38 | + * 0xfe insn_list_threads.h |
| 39 | + * <none> insn_list_noprefix.h |
| 40 | + */ |
| 41 | + |
30 | 42 | struct exec_instruction_desc { |
31 | 43 | /* |
32 | 44 | * fetch_exec is called after fetching the first byte of |
@@ -866,13 +878,7 @@ const static struct exec_instruction_desc |
866 | 878 | #endif |
867 | 879 |
|
868 | 880 | const struct exec_instruction_desc exec_instructions[] __exec_table_align = { |
869 | | -#include "insn_list_base.h" |
870 | | -#if defined(TOYWASM_ENABLE_WASM_TAILCALL) |
871 | | -#include "insn_list_tailcall.h" |
872 | | -#endif /* defined(TOYWASM_ENABLE_WASM_TAILCALL) */ |
873 | | -#if defined(TOYWASM_ENABLE_WASM_EXCEPTION_HANDLING) |
874 | | -#include "insn_list_eh.h" |
875 | | -#endif /* defined(TOYWASM_ENABLE_WASM_EXCEPTION_HANDLING) */ |
| 881 | +#include "insn_list_noprefix.h" |
876 | 882 | }; |
877 | 883 |
|
878 | 884 | #undef INSTRUCTION |
@@ -989,13 +995,7 @@ const static struct instruction_desc instructions_fe[] = { |
989 | 995 | * a few optimizations in the parser by allowing full uint8_t index. |
990 | 996 | */ |
991 | 997 | static const struct instruction_desc instructions[256] = { |
992 | | -#include "insn_list_base.h" |
993 | | -#if defined(TOYWASM_ENABLE_WASM_TAILCALL) |
994 | | -#include "insn_list_tailcall.h" |
995 | | -#endif /* defined(TOYWASM_ENABLE_WASM_TAILCALL) */ |
996 | | -#if defined(TOYWASM_ENABLE_WASM_EXCEPTION_HANDLING) |
997 | | -#include "insn_list_eh.h" |
998 | | -#endif /* defined(TOYWASM_ENABLE_WASM_EXCEPTION_HANDLING) */ |
| 998 | +#include "insn_list_noprefix.h" |
999 | 999 | }; |
1000 | 1000 |
|
1001 | 1001 | static const size_t instructions_size = ARRAYCOUNT(instructions); |
|
0 commit comments