enable multiple vm engines (regular, debug, ...)
authorAndy Wingo <wingo@pobox.com>
Wed, 4 Feb 2009 22:47:56 +0000 (23:47 +0100)
committerAndy Wingo <wingo@pobox.com>
Wed, 4 Feb 2009 22:47:56 +0000 (23:47 +0100)
commit6d14383e866f447a0d2656fd319ba68a5737202c
tree85eeff88a88f7eb96e865aacd83cb2eedf7bc4c3
parentbef959110427b00bd07b0ac35b1baa2db2bc4828
enable multiple vm engines (regular, debug, ...)

* libguile/vm-engine.c (VM_USE_HOOKS, VM_USE_CLOCK, VM_CHECK_EXTERNAL)
  (VM_CHECK_OBJECT): Update to define these here, before including
  vm-engine.h.
  (vm_run): Change so that we can make different engines. Also, we take
  an array of arguments, and the struct scm_vm directly, so as to avoid
  any need to cons.

* libguile/vm-engine.h (CHECK_EXTERNAL, CHECK_OBJECT): Add some UNLIKELY
  bits; don't seem to help.

* libguile/vm.c (vm_dispatch_hook): Change to not pass the VP. This needs
  some love, and perhaps we revert to the old way.
  (VM_ENGINE): Actually make two engines, vm_regular_engine and
  vm_debug_engine. Probably there is room for improvement here. Actually
  their speeds are the same at the moment.
  (make_vm): Choose which engine to run; currently the debug engine by
  default.
  (scm_c_vm_run): A thin wrapper to invoke a VM without consing.
  (scm_vm_apply): Use scm_c_vm_run.
  (scm_load_compiled_with_vm): Use scm_c_vm_run.
libguile/vm-engine.c
libguile/vm-engine.h
libguile/vm.c
libguile/vm.h