[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 10/26: expand_stack intrinsic takes thread
From: |
Andy Wingo |
Subject: |
[Guile-commits] 10/26: expand_stack intrinsic takes thread |
Date: |
Tue, 26 Jun 2018 11:26:10 -0400 (EDT) |
wingo pushed a commit to branch master
in repository guile.
commit 6ceb33e7675e1e4f6aa4f0304bf363d1da5eb085
Author: Andy Wingo <address@hidden>
Date: Sun Jun 24 10:07:52 2018 +0200
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.
---
libguile/intrinsics.h | 4 ++--
libguile/vm-engine.c | 2 +-
libguile/vm.c | 8 +++++++-
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/libguile/intrinsics.h b/libguile/intrinsics.h
index e488a95..46a7fdd 100644
--- a/libguile/intrinsics.h
+++ b/libguile/intrinsics.h
@@ -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 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*);
+typedef void (*scm_t_thread_sp_intrinsic) (scm_i_thread*, union
scm_vm_stack_element*);
#define SCM_FOR_ALL_VM_INTRINSICS(M) \
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_scm, lookup, "lookup", LOOKUP) \
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. */
enum scm_vm_intrinsic
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c
index 5e1114f..4874c0f 100644
--- a/libguile/vm-engine.c
+++ b/libguile/vm-engine.c
@@ -182,7 +182,7 @@
{ \
struct scm_vm_intrinsics *i = (void*)intrinsics; \
SYNC_IP (); \
- i->expand_stack (VP, sp); \
+ i->expand_stack (thread, sp); \
CACHE_SP (); \
} \
else \
diff --git a/libguile/vm.c b/libguile/vm.c
index 3cfe973..bf77c01 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -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_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,
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_error = scm_from_latin1_symbol ("vm-error");
- [Guile-commits] branch master updated (1234bb1 -> 51e71a4), Andy Wingo, 2018/06/26
- [Guile-commits] 05/26: Add __scm.h placeholder, Andy Wingo, 2018/06/26
- [Guile-commits] 04/26: Deprecate scm_t_uint8 and similar typedefs, Andy Wingo, 2018/06/26
- [Guile-commits] 09/26: Fix intrinsics copyright line and include guards, Andy Wingo, 2018/06/26
- [Guile-commits] 07/26: Eagerly initialize thread VM; remove scm_the_vm, Andy Wingo, 2018/06/26
- [Guile-commits] 06/26: Inline struct scm_vm into struct scm_i_thread, Andy Wingo, 2018/06/26
- [Guile-commits] 03/26: Use ptrdiff_t instead of scm_t_ptrdiff, Andy Wingo, 2018/06/26
- [Guile-commits] 10/26: expand_stack intrinsic takes thread,
Andy Wingo <=
- [Guile-commits] 01/26: Start to use C99 stdint in gen-scmconfig, Andy Wingo, 2018/06/26
- [Guile-commits] 08/26: VM gets VP from thread, Andy Wingo, 2018/06/26
- [Guile-commits] 20/26: Add intrinsic for call/cc, Andy Wingo, 2018/06/26
- [Guile-commits] 18/26: Refactor continuation capture in VM, Andy Wingo, 2018/06/26
- [Guile-commits] 17/26: Foreign-call intrinsic boxes errno, Andy Wingo, 2018/06/26
- [Guile-commits] 25/26: Optimize abort-to-prompt to avoid alloca, Andy Wingo, 2018/06/26
- [Guile-commits] 15/26: Most header files use forward decl for union scm_vm_stack_element, Andy Wingo, 2018/06/26
- [Guile-commits] 14/26: Add intrinsic for foreign-call, Andy Wingo, 2018/06/26
- [Guile-commits] 11/26: Move VM keyword argument parsing to happen via an intrinsic, Andy Wingo, 2018/06/26
- [Guile-commits] 22/26: Add rest-arg-length intrinsic., Andy Wingo, 2018/06/26