rework vm tracing
authorAndy Wingo <wingo@pobox.com>
Mon, 21 Dec 2009 20:57:20 +0000 (21:57 +0100)
committerAndy Wingo <wingo@pobox.com>
Mon, 21 Dec 2009 20:57:20 +0000 (21:57 +0100)
commit7656f194465ed50901c9cf3e31a68c3014b576ba
tree09e7dbdbc7d32d797ffff984e56e080de7713221
parent86fd6dff2a77150148ed7b3d9152e0a431070666
rework vm tracing

* libguile/vm-engine.c (VM_NAME): Engines take the VM itself (not the
  vp), so they can pass the VM to hooks. No more hook args, we dispatch
  without them.

* libguile/vm-engine.h (RUN_HOOK): Dispatch the hook if the trace level
  is positive (instead of if the hook is there). Don't cache registers
  on return from the dispatch.

* libguile/vm.h:
* libguile/vm.c (vm_dispatch_hook): Don't bother with a dynwind; instead
  decrement the trace level when going into a hook, and if we have a
  nonlocal exit, the trace level never gets incremented again. Worse is
  better.
  (make_vm, scm_vm_trace_level, scm_set_vm_trace_level_x): New concept,
  trace level. If positive, we run the hooks, otherwise we don't. Should
  work. Removed scm_vm_trace_frame, I don't think that was the right way
  to do it.

* module/system/vm/vm.scm: Replace vm-trace-frame with vm-trace-level
  and set-vm-trace-level!; the hooks actually get the frame as an
  argument now.
libguile/vm-engine.c
libguile/vm-engine.h
libguile/vm.c
libguile/vm.h
module/system/vm/vm.scm