interp_stubs.c (2335B)
1 /* Stubs for the public interpreter API when KIT_INTERP_ENABLED == 0. 2 * Mirrors src/arch/disasm_stubs.c: the only callers of a disabled interpreter 3 * are external (the `kit run --no-jit` path, embedders), so the public 4 * kit_interp_* surface returns NULL / KIT_UNSUPPORTED. This file is added 5 * to the build only in the disabled branch (see Makefile). */ 6 7 #include <kit/interp.h> 8 9 KitInterpProgram* kit_interp_program_new(KitCompiler* c) { 10 (void)c; 11 return NULL; 12 } 13 14 void kit_interp_program_free(KitInterpProgram* p) { (void)p; } 15 16 void kit_interp_program_attach(KitInterpProgram* p, KitCompiler* c) { 17 (void)p; 18 (void)c; 19 } 20 21 void kit_interp_program_set_host(KitInterpProgram* p, 22 const KitInterpHost* host) { 23 (void)p; 24 (void)host; 25 } 26 27 KitInterpFunc* kit_interp_lookup(KitInterpProgram* p, KitSlice name) { 28 (void)p; 29 (void)name; 30 return NULL; 31 } 32 33 KitInterpStack* kit_interp_stack_new(KitInterpProgram* p) { 34 (void)p; 35 return NULL; 36 } 37 38 void kit_interp_stack_free(KitInterpStack* s) { (void)s; } 39 40 KitStatus kit_interp_call_on(KitInterpStack* s, KitInterpFunc* fn, int argc, 41 char** argv) { 42 (void)s; 43 (void)fn; 44 (void)argc; 45 (void)argv; 46 return KIT_UNSUPPORTED; 47 } 48 49 KitInterpStatus kit_interp_resume(KitInterpStack* s, int64_t* out_ret) { 50 (void)s; 51 (void)out_ret; 52 return KIT_INTERP_ERROR; 53 } 54 55 KitInterpStatus kit_interp_call(KitInterpProgram* p, KitInterpFunc* fn, 56 int argc, char** argv, int64_t* out_ret) { 57 (void)p; 58 (void)fn; 59 (void)argc; 60 (void)argv; 61 (void)out_ret; 62 return KIT_INTERP_ERROR; 63 } 64 65 KitInterpStatus kit_interp_call_args(KitInterpProgram* p, KitInterpFunc* fn, 66 const uint64_t* args, uint32_t nargs, 67 int64_t* out_ret) { 68 (void)p; 69 (void)fn; 70 (void)args; 71 (void)nargs; 72 (void)out_ret; 73 return KIT_INTERP_ERROR; 74 } 75 76 KitStatus kit_interp_stack_reset(KitInterpStack* s) { 77 (void)s; 78 return KIT_UNSUPPORTED; 79 } 80 81 KitStatus kit_interp_call_args_on(KitInterpStack* s, KitInterpFunc* fn, 82 const uint64_t* args, uint32_t nargs) { 83 (void)s; 84 (void)fn; 85 (void)args; 86 (void)nargs; 87 return KIT_UNSUPPORTED; 88 } 89 90 const char* kit_interp_stack_trap_reason(KitInterpStack* s) { 91 (void)s; 92 return NULL; 93 }