guile-commits
[Top][All Lists]
Advanced

[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");



reply via email to

[Prev in Thread] Current Thread [Next in Thread]