diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c index 669d3cca1..85674c040 100644 --- a/libguile/vm-engine.c +++ b/libguile/vm-engine.c @@ -60,14 +60,6 @@ while (0) -#if (VM_ENGINE == SCM_VM_REGULAR_ENGINE) -# define VM_USE_HOOKS 0 /* Various hooks */ -#elif (VM_ENGINE == SCM_VM_DEBUG_ENGINE) -# define VM_USE_HOOKS 1 -#else -# error unknown debug engine VM_ENGINE -#endif - /* Assign some registers by hand. There used to be a bigger list here, but it was never tested, and in the case of x86-32, was a source of compilation failures. It can be revived if it's useful, but my naive @@ -427,7 +419,7 @@ ((scm_t_uintptr) (ptr) % alignof_type (type) == 0) static SCM -RTL_VM_NAME (SCM vm, SCM program, SCM *argv, size_t nargs_) +VM_NAME (SCM vm, SCM program, SCM *argv, size_t nargs_) { /* Instruction pointer: A pointer to the opcode that is currently running. */ diff --git a/libguile/vm.c b/libguile/vm.c index 8e8436dbc..8758088e2 100644 --- a/libguile/vm.c +++ b/libguile/vm.c @@ -755,26 +755,26 @@ initialize_default_stack_size (void) vm_stack_size = size; } -#define RTL_VM_NAME rtl_vm_regular_engine +#define VM_NAME vm_regular_engine +#define VM_USE_HOOKS 0 #define FUNC_NAME "vm-regular-engine" -#define VM_ENGINE SCM_VM_REGULAR_ENGINE #include "vm-engine.c" -#undef RTL_VM_NAME #undef FUNC_NAME -#undef VM_ENGINE +#undef VM_USE_HOOKS +#undef VM_NAME -#define RTL_VM_NAME rtl_vm_debug_engine +#define VM_NAME vm_debug_engine +#define VM_USE_HOOKS 1 #define FUNC_NAME "vm-debug-engine" -#define VM_ENGINE SCM_VM_DEBUG_ENGINE #include "vm-engine.c" -#undef RTL_VM_NAME #undef FUNC_NAME -#undef VM_ENGINE +#undef VM_USE_HOOKS +#undef VM_NAME -typedef SCM (*scm_t_rtl_vm_engine) (SCM vm, SCM program, SCM *argv, size_t nargs); +typedef SCM (*scm_t_vm_engine) (SCM vm, SCM program, SCM *argv, size_t nargs); -static const scm_t_rtl_vm_engine rtl_vm_engines[] = - { rtl_vm_regular_engine, rtl_vm_debug_engine }; +static const scm_t_vm_engine vm_engines[SCM_VM_NUM_ENGINES] = + { vm_regular_engine, vm_debug_engine }; #ifdef VM_ENABLE_PRECISE_STACK_GC_SCAN @@ -859,7 +859,7 @@ scm_c_vm_run (SCM vm, SCM program, SCM *argv, int nargs) { struct scm_vm *vp = SCM_VM_DATA (vm); SCM_CHECK_STACK; - return rtl_vm_engines[vp->engine](vm, program, argv, nargs); + return vm_engines[vp->engine](vm, program, argv, nargs); } /* Scheme interface */ diff --git a/libguile/vm.h b/libguile/vm.h index c678e421b..bb0745420 100644 --- a/libguile/vm.h +++ b/libguile/vm.h @@ -34,8 +34,6 @@ enum { struct scm_vm; -typedef SCM (*scm_t_vm_engine) (SCM vm, SCM program, SCM *argv, int nargs); - #define SCM_VM_REGULAR_ENGINE 0 #define SCM_VM_DEBUG_ENGINE 1 #define SCM_VM_NUM_ENGINES 2