mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 21:10:27 +02:00
expand_stack intrinsic takes thread
* libguile/intrinsics.h (scm_t_thread_sp_intrinsic): Change to take thread instead of vp. (SCM_FOR_ALL_VM_INTRINSICS): Change expand_stack to expect thread, not vp. * libguile/vm-engine.c (ALLOC_FRAME): Call expand_stack with thread. * libguile/vm.c (thread_expand_stack, scm_bootstrap_vm): Adapt.
This commit is contained in:
parent
150f3474df
commit
6ceb33e767
3 changed files with 10 additions and 4 deletions
|
@ -42,7 +42,7 @@ typedef SCM (*scm_t_scm_from_thread_scm_intrinsic) (scm_i_thread*, SCM);
|
||||||
typedef SCM (*scm_t_scm_from_scm_u64_intrinsic) (SCM, uint64_t);
|
typedef SCM (*scm_t_scm_from_scm_u64_intrinsic) (SCM, uint64_t);
|
||||||
typedef int (*scm_t_bool_from_scm_scm_intrinsic) (SCM, SCM);
|
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 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*);
|
typedef void (*scm_t_thread_sp_intrinsic) (scm_i_thread*, union scm_vm_stack_element*);
|
||||||
|
|
||||||
#define SCM_FOR_ALL_VM_INTRINSICS(M) \
|
#define SCM_FOR_ALL_VM_INTRINSICS(M) \
|
||||||
M(scm_from_scm_scm, add, "add", ADD) \
|
M(scm_from_scm_scm, add, "add", ADD) \
|
||||||
|
@ -87,7 +87,7 @@ typedef void (*scm_t_vp_sp_intrinsic) (struct scm_vm*, union scm_vm_stack_elemen
|
||||||
M(scm_from_scm_uimm, resolve_module, "resolve-module", RESOLVE_MODULE) \
|
M(scm_from_scm_uimm, resolve_module, "resolve-module", RESOLVE_MODULE) \
|
||||||
M(scm_from_scm_scm, lookup, "lookup", LOOKUP) \
|
M(scm_from_scm_scm, lookup, "lookup", LOOKUP) \
|
||||||
M(scm_from_scm_scm, define_x, "define!", DEFINE_X) \
|
M(scm_from_scm_scm, define_x, "define!", DEFINE_X) \
|
||||||
M(vp_sp, expand_stack, "expand-stack", EXPAND_STACK) \
|
M(thread_sp, expand_stack, "expand-stack", EXPAND_STACK) \
|
||||||
/* Add new intrinsics here; also update scm_bootstrap_intrinsics. */
|
/* Add new intrinsics here; also update scm_bootstrap_intrinsics. */
|
||||||
|
|
||||||
enum scm_vm_intrinsic
|
enum scm_vm_intrinsic
|
||||||
|
|
|
@ -182,7 +182,7 @@
|
||||||
{ \
|
{ \
|
||||||
struct scm_vm_intrinsics *i = (void*)intrinsics; \
|
struct scm_vm_intrinsics *i = (void*)intrinsics; \
|
||||||
SYNC_IP (); \
|
SYNC_IP (); \
|
||||||
i->expand_stack (VP, sp); \
|
i->expand_stack (thread, sp); \
|
||||||
CACHE_SP (); \
|
CACHE_SP (); \
|
||||||
} \
|
} \
|
||||||
else \
|
else \
|
||||||
|
|
|
@ -1158,6 +1158,12 @@ vm_expand_stack (struct scm_vm *vp, union scm_vm_stack_element *new_sp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
thread_expand_stack (scm_i_thread *thread, union scm_vm_stack_element *new_sp)
|
||||||
|
{
|
||||||
|
vm_expand_stack (&thread->vm, new_sp);
|
||||||
|
}
|
||||||
|
|
||||||
SCM
|
SCM
|
||||||
scm_call_n (SCM proc, SCM *argv, size_t nargs)
|
scm_call_n (SCM proc, SCM *argv, size_t nargs)
|
||||||
{
|
{
|
||||||
|
@ -1496,7 +1502,7 @@ scm_bootstrap_vm (void)
|
||||||
(scm_t_extension_init_func)scm_init_vm_builtins,
|
(scm_t_extension_init_func)scm_init_vm_builtins,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
scm_vm_intrinsics.expand_stack = vm_expand_stack;
|
scm_vm_intrinsics.expand_stack = thread_expand_stack;
|
||||||
|
|
||||||
sym_vm_run = scm_from_latin1_symbol ("vm-run");
|
sym_vm_run = scm_from_latin1_symbol ("vm-run");
|
||||||
sym_vm_error = scm_from_latin1_symbol ("vm-error");
|
sym_vm_error = scm_from_latin1_symbol ("vm-error");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue