mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-01 04:10:18 +02:00
Call out to expand_stack through new VM intrinsic
* libguile/intrinsics.h (scm_t_vp_sp_intrinsic): New type. (SCM_FOR_ALL_VM_INTRINSICS): Add expand-stack. * libguile/vm-engine.c (ALLOC_FRAME): Call through the intrinsics. * libguile/vm.c (scm_bootstrap_vm): Initialize the expand-stack intrinsic.
This commit is contained in:
parent
3b463516ef
commit
ceaf782770
3 changed files with 5 additions and 1 deletions
|
@ -41,6 +41,7 @@ typedef SCM (*scm_t_scm_from_thread_scm_intrinsic) (scm_i_thread*, SCM);
|
|||
typedef SCM (*scm_t_scm_from_scm_u64_intrinsic) (SCM, scm_t_uint64);
|
||||
typedef int (*scm_t_bool_from_scm_scm_intrinsic) (SCM, SCM);
|
||||
typedef enum scm_compare (*scm_t_compare_from_scm_scm_intrinsic) (SCM, SCM);
|
||||
typedef void (*scm_t_vp_sp_intrinsic) (struct scm_vm*, union scm_vm_stack_element*);
|
||||
|
||||
#define SCM_FOR_ALL_VM_INTRINSICS(M) \
|
||||
M(scm_from_scm_scm, add, "add", ADD) \
|
||||
|
@ -85,6 +86,7 @@ typedef enum scm_compare (*scm_t_compare_from_scm_scm_intrinsic) (SCM, SCM);
|
|||
M(scm_from_scm_uimm, resolve_module, "resolve-module", RESOLVE_MODULE) \
|
||||
M(scm_from_scm_scm, lookup, "lookup", LOOKUP) \
|
||||
M(scm_from_scm_scm, define_x, "define!", DEFINE_X) \
|
||||
M(vp_sp, expand_stack, "expand-stack", EXPAND_STACK) \
|
||||
/* Add new intrinsics here; also update scm_bootstrap_intrinsics. */
|
||||
|
||||
enum scm_vm_intrinsic
|
||||
|
|
|
@ -178,8 +178,9 @@
|
|||
{ \
|
||||
if (SCM_UNLIKELY (sp < vp->stack_limit)) \
|
||||
{ \
|
||||
struct scm_vm_intrinsics *i = (void*)intrinsics; \
|
||||
SYNC_IP (); \
|
||||
vm_expand_stack (vp, sp); \
|
||||
i->expand_stack (vp, sp); \
|
||||
CACHE_SP (); \
|
||||
} \
|
||||
else \
|
||||
|
|
|
@ -1481,6 +1481,7 @@ scm_bootstrap_vm (void)
|
|||
/* page_size should be a power of two. */
|
||||
if (page_size & (page_size - 1))
|
||||
abort ();
|
||||
scm_vm_intrinsics.expand_stack = vm_expand_stack;
|
||||
|
||||
sym_vm_run = scm_from_latin1_symbol ("vm-run");
|
||||
sym_vm_error = scm_from_latin1_symbol ("vm-error");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue