diff options
author | Andy Wingo <wingo@pobox.com> | 2010-09-27 21:06:24 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2010-09-27 21:12:29 +0200 |
commit | ea9f4f4b1551b4a82d4726f2833070f1fb3e2cd5 (patch) | |
tree | 09c4463332aaa0d5c60df7b168958dce0eeed7f9 /libguile/vm.h | |
parent | 864e7d424e077518decbe6fd59cf4cca4037418a (diff) | |
download | guile-ea9f4f4b1551b4a82d4726f2833070f1fb3e2cd5.tar.gz |
add call-with-vm; remove thread-vm bits; remove vm-apply; engines settable.
* libguile/vm.h (scm_c_vm_run): Make internal.
* libguile/vm.c (vm_default_engine): New static global variable.
(make_vm): Set vp->engine based on
(scm_vm_apply): Remove in favor of call-with-vm.
(scm_thread_vm, scm_set_thread_vm_x): Remove these, as they did not
have a well-defined meaning, and were dangerous to call on other
threads.
(scm_the_vm): Reinstate previous definition.
(symbol_to_vm_engine, vm_engine_to_symbol)
(vm_has_pending_computation): New helpers.
(scm_vm_engine, scm_set_vm_engine_x, scm_c_set_vm_engine_x): New
accessors for VM engines.
(scm_c_set_default_vm_engine_x, scm_set_default_vm_engine_x): New
setters for the default VM engine.
(scm_call_with_vm): New function, applies a procedure to arguments in
a context in which a given VM is current.
* libguile/eval.c (eval, scm_apply): VM dispatch goes through
scm_call_with_vm.
* test-suite/tests/control.test ("the-vm"):
* module/system/vm/coverage.scm (with-code-coverage): Use call-with-vm.
* module/system/vm/vm.scm: Update exports.
* test-suite/vm/run-vm-tests.scm (run-vm-program):
* test-suite/tests/compiler.test ("current-reader"): Just rely on the
result of make-program being an applicable.
* test-suite/tests/eval.test ("stack overflow"): Add a note that this
test does not test what it should.
Diffstat (limited to 'libguile/vm.h')
-rw-r--r-- | libguile/vm.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libguile/vm.h b/libguile/vm.h index 36dc1dccb..bb7a7df8b 100644 --- a/libguile/vm.h +++ b/libguile/vm.h @@ -61,12 +61,10 @@ SCM_API SCM scm_the_vm_fluid; SCM_API SCM scm_the_vm (); SCM_API SCM scm_make_vm (void); -SCM_API SCM scm_vm_apply (SCM vm, SCM program, SCM args); -SCM_API SCM scm_c_vm_run (SCM vm, SCM program, SCM *argv, int nargs); -SCM_API SCM scm_thread_vm (SCM t); -SCM_API SCM scm_set_thread_vm_x (SCM t, SCM vm); SCM_API SCM scm_the_vm (void); +SCM_API SCM scm_call_with_vm (SCM vm, SCM proc, SCM args); + SCM_API SCM scm_vm_p (SCM obj); SCM_API SCM scm_vm_ip (SCM vm); SCM_API SCM scm_vm_sp (SCM vm); @@ -79,6 +77,11 @@ SCM_API SCM scm_vm_restore_continuation_hook (SCM vm); SCM_API SCM scm_vm_next_hook (SCM vm); SCM_API SCM scm_vm_trace_level (SCM vm); SCM_API SCM scm_set_vm_trace_level_x (SCM vm, SCM level); +SCM_API SCM scm_vm_engine (SCM vm); +SCM_API SCM scm_set_vm_engine_x (SCM vm, SCM engine); +SCM_API SCM scm_set_default_vm_engine_x (SCM engine); +SCM_API void scm_c_set_vm_engine_x (SCM vm, int engine); +SCM_API void scm_c_set_default_vm_engine_x (int engine); #define SCM_F_VM_CONT_PARTIAL 0x1 #define SCM_F_VM_CONT_REWINDABLE 0x2 @@ -100,6 +103,8 @@ struct scm_vm_cont { SCM_API SCM scm_load_compiled_with_vm (SCM file); +SCM_INTERNAL SCM scm_c_vm_run (SCM vm, SCM program, SCM *argv, int nargs); + SCM_INTERNAL void scm_i_vm_print (SCM x, SCM port, scm_print_state *pstate); SCM_INTERNAL SCM scm_i_vm_capture_continuation (SCM vm); |