1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00

Lingering RTL excision in vm.c

* libguile/vm-engine.c:
* libguile/vm.c: Rework VM inclusion so that we don't define VM_ENGINE
  and expect vm-engine.c to understand that -- since there is only
  VM_USE_HOOKS, define that in vm.c directly.  Rename rtl_vm_foo to
  vm_foo.

* libguile/vm.h: Remove scm_t_vm_engine typedef.
This commit is contained in:
Andy Wingo 2013-11-19 21:26:26 +01:00
parent 20b1b91394
commit f42cfbf0b7
3 changed files with 13 additions and 23 deletions

View file

@ -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. */

View file

@ -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 */

View file

@ -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