1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-22 19:44:10 +02:00

push and pop dynamic state via intrinsics

* libguile/intrinsics.c (push_dynamic_state, pop_dynamic_state): New
  intrinsics.
  (scm_bootstrap_intrinsics): Add new intrinsics.
* libguile/intrinsics.h: Declare new intrinsics.
* libguile/vm-engine.c (call-thread-scm): New intrinsic caller.
  (push-dynamic-state, pop-dynamic-state): Disable.
* module/language/cps/reify-primitives.scm (compute-known-primitives):
  Add new intrinsics.
* module/system/vm/assembler.scm (push-dynamic-state)
  (pop-dynamic-state): Emit as intrinsics.
This commit is contained in:
Andy Wingo 2018-04-29 10:41:24 +02:00
parent 2eb9c755d1
commit 89fda6da60
5 changed files with 49 additions and 19 deletions

View file

@ -32,8 +32,9 @@ typedef scm_t_uint64 (*scm_t_u64_from_scm_intrinsic) (SCM);
typedef scm_t_int64 (*scm_t_s64_from_scm_intrinsic) (SCM);
typedef SCM (*scm_t_scm_from_u64_intrinsic) (scm_t_uint64);
typedef SCM (*scm_t_scm_from_s64_intrinsic) (scm_t_int64);
typedef void (*scm_t_thread_scm_scm_intrinsic) (scm_i_thread*, SCM, SCM);
typedef void (*scm_t_thread_intrinsic) (scm_i_thread*);
typedef void (*scm_t_thread_scm_intrinsic) (scm_i_thread*, SCM);
typedef void (*scm_t_thread_scm_scm_intrinsic) (scm_i_thread*, SCM, SCM);
typedef SCM (*scm_t_scm_from_thread_scm_intrinsic) (scm_i_thread*, SCM);
#define SCM_FOR_ALL_VM_INTRINSICS(M) \
@ -67,6 +68,8 @@ typedef SCM (*scm_t_scm_from_thread_scm_intrinsic) (scm_i_thread*, SCM);
M(thread, pop_fluid, "pop-fluid", POP_FLUID) \
M(scm_from_thread_scm, fluid_ref, "fluid-ref", FLUID_REF) \
M(thread_scm_scm, fluid_set_x, "fluid-set!", FLUID_SET_X) \
M(thread_scm, push_dynamic_state, "push-dynamic-state", PUSH_DYNAMIC_STATE) \
M(thread, pop_dynamic_state, "pop-dynamic-state", POP_DYNAMIC_STATE) \
/* Add new intrinsics here; also update scm_bootstrap_intrinsics. */
enum scm_vm_intrinsic