guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, master, updated. v2.1.0-392-gcb8ea38


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, master, updated. v2.1.0-392-gcb8ea38
Date: Fri, 15 Nov 2013 16:14:34 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=cb8ea3805f02684c17c5dd8b55714dc1e8ce6c48

The branch, master has been updated
       via  cb8ea3805f02684c17c5dd8b55714dc1e8ce6c48 (commit)
       via  f8085163d6c457e79d3f54934723707260ac8dd8 (commit)
       via  840ec33422e7ccae5ac158584e5587d88ff42d85 (commit)
      from  0c247a2fb6a9872b262eb7558e62481ac1967063 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cb8ea3805f02684c17c5dd8b55714dc1e8ce6c48
Author: Andy Wingo <address@hidden>
Date:   Fri Nov 15 17:14:15 2013 +0100

    Remove use of SCM_CRITICAL_SECTION in smob.c
    
    * libguile/smob.c (scm_make_smob_type): Use a mutex instead of a
      critical section, which does an async tick.  Not important, just a
      thing I saw.

commit f8085163d6c457e79d3f54934723707260ac8dd8
Author: Andy Wingo <address@hidden>
Date:   Fri Nov 15 17:13:10 2013 +0100

    Remove MVRA from VM frames
    
    * libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump for frame layout
      change.
    
    * libguile/frames.c: Update some static checks.
      (scm_frame_num_locals, scm_frame_local_ref, scm_frame_local_set_x):
      Update to not skip over uninitialized frames, as that's not a thing
      any more.
    
    * libguile/frames.h: Update to remove MVRA.  Woo!
    
    * libguile/vm-engine.c (ALLOC_FRAME, RETURN_ONE_VALUE):
      (rtl_vm_engine): Update for 3 words per frame instead of 4.
    
    * libguile/vm.c (vm_return_to_continuation): Likewise.
    
    * module/language/cps/slot-allocation.scm (allocate-slots): 3 words per
      frame, not 4.
    
    * module/system/vm/assembler.scm (*bytecode-minor-version*): Bump.  Also
      remove a couple of tc7's that aren't around any more.

commit 840ec33422e7ccae5ac158584e5587d88ff42d85
Author: Andy Wingo <address@hidden>
Date:   Fri Nov 15 15:39:38 2013 +0100

    Remove MVRA accessors in libguile
    
    * libguile/vm.c (scm_i_vm_capture_stack): Remove MVRA argument, in
      preparation for removing MVRA from frames.
      (scm_i_capture_current_stack): Adapt to scm_i_vm_capture_stack
      change.
      (vm_reinstate_partial_continuation): Remove references to MVRA.
    
    * libguile/vm.h (struct scm_vm_cont): Remove mvra member.
    
    * libguile/vm-engine.c (call): Set MVRA to 0.  Will remove later.
      (return-values): Return to RA.
      (call/cc): Remove MVRA from capture call.
    
    * libguile/frames.c:
    * libguile/frames.h (SCM_FRAME_MV_RETURN_ADDRESS)
      (SCM_FRAME_RTL_MV_RETURN_ADDRESS, scm_frame_mv_return_address): Remove
      accessors.
    
    * libguile/control.c (reify_partial_continuation): Adapt to
      scm_i_vm_capture_stack change.

-----------------------------------------------------------------------

Summary of changes:
 libguile/_scm.h                         |    2 +-
 libguile/control.c                      |    4 +-
 libguile/frames.c                       |   62 +++++--------------------------
 libguile/frames.h                       |   47 ++++++-----------------
 libguile/smob.c                         |    4 +-
 libguile/vm-engine.c                    |   46 ++++++++++-------------
 libguile/vm.c                           |   25 +++---------
 libguile/vm.h                           |    4 +-
 module/language/cps/slot-allocation.scm |    2 +-
 module/system/vm/assembler.scm          |    4 +-
 10 files changed, 57 insertions(+), 143 deletions(-)

diff --git a/libguile/_scm.h b/libguile/_scm.h
index 9175eb7..ee37fc3 100644
--- a/libguile/_scm.h
+++ b/libguile/_scm.h
@@ -270,7 +270,7 @@ void scm_ia64_longjmp (scm_i_jmp_buf *, int);
 
 /* Major and minor versions must be single characters. */
 #define SCM_OBJCODE_MAJOR_VERSION 3
-#define SCM_OBJCODE_MINOR_VERSION 2
+#define SCM_OBJCODE_MINOR_VERSION 3
 #define SCM_OBJCODE_MAJOR_VERSION_STRING        \
   SCM_CPP_STRINGIFY(SCM_OBJCODE_MAJOR_VERSION)
 #define SCM_OBJCODE_MINOR_VERSION_STRING        \
diff --git a/libguile/control.c b/libguile/control.c
index 7120ffe..aad5aba 100644
--- a/libguile/control.c
+++ b/libguile/control.c
@@ -108,12 +108,10 @@ reify_partial_continuation (SCM vm,
   if (SCM_FRAME_DYNAMIC_LINK (bottom_fp) != saved_fp)
     abort();
 
-  /* Capture from the top of the thunk application frame up to the end. Set an
-     MVRA only, as the post-abort code is in an MV context. */
+  /* Capture from the top of the thunk application frame up to the end. */
   vm_cont = scm_i_vm_capture_stack (bottom_fp - 1,
                                     SCM_VM_DATA (vm)->fp,
                                     SCM_VM_DATA (vm)->sp,
-                                    NULL,
                                     SCM_VM_DATA (vm)->ip,
                                     dynstack,
                                     flags);
diff --git a/libguile/frames.c b/libguile/frames.c
index ce671b8..5ba600b 100644
--- a/libguile/frames.c
+++ b/libguile/frames.c
@@ -28,7 +28,7 @@
 
 /* Make sure assumptions on the layout of `struct scm_vm_frame' hold.  */
 verify (sizeof (SCM) == sizeof (SCM *));
-verify (sizeof (struct scm_vm_frame) == 5 * sizeof (SCM));
+verify (sizeof (struct scm_vm_frame) == 4 * sizeof (SCM));
 verify (offsetof (struct scm_vm_frame, dynamic_link) == 0);
 
 
@@ -110,39 +110,28 @@ SCM_DEFINE (scm_frame_source, "frame-source", 1, 0, 0,
 }
 #undef FUNC_NAME
 
-/* The number of locals would be a simple thing to compute, if it weren't for
-   the presence of not-yet-active frames on the stack. So we have a cheap
-   heuristic to detect not-yet-active frames, and skip over them. Perhaps we
-   should represent them more usefully.
-*/
 SCM_DEFINE (scm_frame_num_locals, "frame-num-locals", 1, 0, 0,
            (SCM frame),
            "")
 #define FUNC_NAME s_scm_frame_num_locals
 {
   SCM *sp, *p;
-  unsigned int n = 0;
 
   SCM_VALIDATE_VM_FRAME (1, frame);
 
   sp = SCM_VM_FRAME_SP (frame);
   p = SCM_FRAME_STACK_ADDRESS (SCM_VM_FRAME_FP (frame));
 
-  /* The frame size of an RTL program is fixed, except in the case of
-     passing a wrong number of arguments to the program.  So we do
-     need to use an SP for determining the number of locals.  */
   return scm_from_ptrdiff_t (sp + 1 - p);
 }
 #undef FUNC_NAME
 
-/* Need same not-yet-active frame logic here as in frame-num-locals */
 SCM_DEFINE (scm_frame_local_ref, "frame-local-ref", 2, 0, 0,
            (SCM frame, SCM index),
            "")
 #define FUNC_NAME s_scm_frame_local_ref
 {
   SCM *sp, *p;
-  unsigned int n = 0;
   unsigned int i;
 
   SCM_VALIDATE_VM_FRAME (1, frame);
@@ -150,19 +139,10 @@ SCM_DEFINE (scm_frame_local_ref, "frame-local-ref", 2, 0, 
0,
 
   sp = SCM_VM_FRAME_SP (frame);
   p = SCM_FRAME_STACK_ADDRESS (SCM_VM_FRAME_FP (frame));
-  while (p <= sp)
-    {
-      if (SCM_UNPACK (p[0]) == 0)
-        /* skip over not-yet-active frame */
-        p += 3;
-      else if (n == i)
-        return *p;
-      else
-        {
-          p++;
-          n++;
-        }
-    }
+
+  if (p + i <= sp)
+    return SCM_FRAME_VARIABLE (SCM_VM_FRAME_FP (frame), i);
+
   SCM_OUT_OF_RANGE (SCM_ARG2, index);
 }
 #undef FUNC_NAME
@@ -174,7 +154,6 @@ SCM_DEFINE (scm_frame_local_set_x, "frame-local-set!", 3, 
0, 0,
 #define FUNC_NAME s_scm_frame_local_set_x
 {
   SCM *sp, *p;
-  unsigned int n = 0;
   unsigned int i;
 
   SCM_VALIDATE_VM_FRAME (1, frame);
@@ -182,22 +161,13 @@ SCM_DEFINE (scm_frame_local_set_x, "frame-local-set!", 3, 
0, 0,
 
   sp = SCM_VM_FRAME_SP (frame);
   p = SCM_FRAME_STACK_ADDRESS (SCM_VM_FRAME_FP (frame));
-  while (p <= sp)
+
+  if (p + i <= sp)
     {
-      if (SCM_UNPACK (p[0]) == 0)
-        /* skip over not-yet-active frame */
-        p += 3;
-      else if (n == i)
-        {
-          *p = val;
-          return SCM_UNSPECIFIED;
-        }
-      else
-        {
-          p++;
-          n++;
-        }
+      SCM_FRAME_VARIABLE (SCM_VM_FRAME_FP (frame), i) = val;
+      return SCM_UNSPECIFIED;
     }
+
   SCM_OUT_OF_RANGE (SCM_ARG2, index);
 }
 #undef FUNC_NAME
@@ -245,18 +215,6 @@ SCM_DEFINE (scm_frame_return_address, 
"frame-return-address", 1, 0, 0,
 }
 #undef FUNC_NAME
 
-SCM_DEFINE (scm_frame_mv_return_address, "frame-mv-return-address", 1, 0, 0,
-           (SCM frame),
-           "")
-#define FUNC_NAME s_scm_frame_mv_return_address
-{
-  SCM_VALIDATE_VM_FRAME (1, frame);
-  return scm_from_uintptr_t ((scm_t_uintptr)
-                             (SCM_FRAME_MV_RETURN_ADDRESS
-                              (SCM_VM_FRAME_FP (frame))));
-}
-#undef FUNC_NAME
-
 SCM_DEFINE (scm_frame_dynamic_link, "frame-dynamic-link", 1, 0, 0,
            (SCM frame),
            "")
diff --git a/libguile/frames.h b/libguile/frames.h
index 9105311..f3bb9b0 100644
--- a/libguile/frames.h
+++ b/libguile/frames.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, 
Inc.
  * * 
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -50,21 +50,26 @@
    | Program          | <- fp - 1
    +==================+
    | Return address   | <- SCM_FRAME_UPPER_ADDRESS (fp)
-   | MV return address|
-   | Dynamic link     | <- fp - 4 = SCM_FRAME_DATA_ADDRESS (fp) = 
SCM_FRAME_LOWER_ADDRESS (fp)
+   | Dynamic link     | <- fp - 3 = SCM_FRAME_DATA_ADDRESS (fp) = 
SCM_FRAME_LOWER_ADDRESS (fp)
    +==================+
    |                  |
 
    As can be inferred from this drawing, it is assumed that
    `sizeof (SCM *) == sizeof (SCM)', since pointers (the `link' parts) are
-   assumed to be as long as SCM objects.  */
+   assumed to be as long as SCM objects.
+
+   When a program returns multiple values, it will shuffle them down to
+   start contiguously from slot 1, as for a tail call.  This means that
+   when the caller goes to access them, there are 2 or 3 empty words
+   between the top of the caller stack and the bottom of the values,
+   corresponding to the frame that was just popped.
+*/
 
 /* This structure maps to the contents of a VM stack frame.  It can
    alias a frame directly.  */
 struct scm_vm_frame
 {
   SCM *dynamic_link;
-  scm_t_uint8 *mv_return_address;
   scm_t_uint8 *return_address;
   SCM program;
   SCM stack[1]; /* Variable-length */
@@ -73,7 +78,7 @@ struct scm_vm_frame
 #define SCM_FRAME_STRUCT(fp)                           \
   ((struct scm_vm_frame *) SCM_FRAME_DATA_ADDRESS (fp))
 
-#define SCM_FRAME_DATA_ADDRESS(fp)     (((SCM *) (fp)) - 4)
+#define SCM_FRAME_DATA_ADDRESS(fp)     (((SCM *) (fp)) - 3)
 #define SCM_FRAME_STACK_ADDRESS(fp)    (SCM_FRAME_STRUCT (fp)->stack)
 #define SCM_FRAME_UPPER_ADDRESS(fp)    ((SCM*)&SCM_FRAME_STRUCT 
(fp)->return_address)
 #define SCM_FRAME_LOWER_ADDRESS(fp)    ((SCM*)SCM_FRAME_STRUCT (fp))
@@ -85,10 +90,6 @@ struct scm_vm_frame
   (SCM_FRAME_STRUCT (fp)->return_address)
 #define SCM_FRAME_SET_RETURN_ADDRESS(fp, ra)    \
   SCM_FRAME_STRUCT (fp)->return_address = (ra)
-#define SCM_FRAME_MV_RETURN_ADDRESS(fp)         \
-  (SCM_FRAME_STRUCT (fp)->mv_return_address)
-#define SCM_FRAME_SET_MV_RETURN_ADDRESS(fp, mvra)       \
-  SCM_FRAME_STRUCT (fp)->mv_return_address = (mvra)
 #define SCM_FRAME_DYNAMIC_LINK(fp)              \
   (SCM_FRAME_STRUCT (fp)->dynamic_link)
 #define SCM_FRAME_SET_DYNAMIC_LINK(fp, dl)      \
@@ -99,36 +100,13 @@ struct scm_vm_frame
   (SCM_FRAME_STRUCT (fp)->program)
 
 
-/*
- * RTL frames
- */
-
-/* The frame format for the new RTL programs is almost like that for the
-   stack-vm programs.  They differ in their handling of MV returns,
-   however.  For RTL, every call is an MV call: every call has an MVRA.
-   Unlike the stack-vm programs, the MVRA for RTL programs is computable
-   from the RA -- it's always one word (4 bytes) before the RA.
-
-   Until we completely migrate to the RTL VM, we will also write the
-   MVRA to the stack.
-
-   When an RTL program returns multiple values, it will shuffle them
-   down to start contiguously from slot 0, as for a tail call.  This
-   means that when the caller goes to access them, there are 2 or 3
-   empty words between the top of the caller stack and the bottom of the
-   values, corresponding to the frame that was just popped.
-*/
 
+/* FIXME: Replace SCM_FRAME_RETURN_ADDRESS with these.  */
 #define SCM_FRAME_RTL_RETURN_ADDRESS(fp)                \
   ((scm_t_uint32 *) SCM_FRAME_RETURN_ADDRESS (fp))
 #define SCM_FRAME_SET_RTL_RETURN_ADDRESS(fp, ip)        \
   SCM_FRAME_SET_RETURN_ADDRESS (fp, (scm_t_uint8 *) (ip))
 
-#define SCM_FRAME_RTL_MV_RETURN_ADDRESS(fp)             \
-  ((scm_t_uint32 *) SCM_FRAME_MV_RETURN_ADDRESS (fp))
-#define SCM_FRAME_SET_RTL_MV_RETURN_ADDRESS(fp, ip)     \
-  SCM_FRAME_SET_MV_RETURN_ADDRESS (fp, (scm_t_uint8 *) (ip))
-
 
 /*
  * Heap frames
@@ -165,7 +143,6 @@ SCM_API SCM scm_frame_address (SCM frame);
 SCM_API SCM scm_frame_stack_pointer (SCM frame);
 SCM_API SCM scm_frame_instruction_pointer (SCM frame);
 SCM_API SCM scm_frame_return_address (SCM frame);
-SCM_API SCM scm_frame_mv_return_address (SCM frame);
 SCM_API SCM scm_frame_dynamic_link (SCM frame);
 SCM_API SCM scm_frame_previous (SCM frame);
 
diff --git a/libguile/smob.c b/libguile/smob.c
index e13591f..7682578 100644
--- a/libguile/smob.c
+++ b/libguile/smob.c
@@ -205,11 +205,11 @@ scm_make_smob_type (char const *name, size_t size)
 {
   long new_smob;
 
-  SCM_CRITICAL_SECTION_START;
+  scm_i_pthread_mutex_lock (&scm_i_misc_mutex);
   new_smob = scm_numsmob;
   if (scm_numsmob != MAX_SMOB_COUNT)
     ++scm_numsmob;
-  SCM_CRITICAL_SECTION_END;
+  scm_i_pthread_mutex_unlock (&scm_i_misc_mutex);
 
   if (new_smob == MAX_SMOB_COUNT)
     scm_misc_error (FUNC_NAME, "maximum number of smobs exceeded", SCM_EOL);
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c
index 7e66f43..517b8c6 100644
--- a/libguile/vm-engine.c
+++ b/libguile/vm-engine.c
@@ -142,12 +142,12 @@
 
 /* Reserve stack space for a frame.  Will check that there is sufficient
    stack space for N locals, including the procedure, in addition to
-   3 words to set up the next frame.  Invoke after preparing the new
+   2 words to set up the next frame.  Invoke after preparing the new
    frame and setting the fp and ip.  */
 #define ALLOC_FRAME(n)                                              \
   do {                                                              \
     SCM *new_sp = vp->sp = fp - 1 + n - 1;                          \
-    CHECK_OVERFLOW (new_sp + 4);                                    \
+    CHECK_OVERFLOW (new_sp + 3);                                    \
   } while (0)
 
 /* Reset the current frame to hold N locals.  Used when we know that no
@@ -229,10 +229,9 @@
     /* Clear frame. */                                  \
     sp[0] = SCM_BOOL_F;                                 \
     sp[1] = SCM_BOOL_F;                                 \
-    sp[2] = SCM_BOOL_F;                                 \
     /* Leave proc. */                                   \
-    sp[4] = val;                                        \
-    vp->sp = sp + 4;                                    \
+    sp[3] = val;                                        \
+    vp->sp = sp + 3;                                    \
     POP_CONTINUATION_HOOK (sp, 1);                      \
     NEXT (0);                                           \
   } while (0)
@@ -446,11 +445,11 @@ RTL_VM_NAME (SCM vm, SCM program, SCM *argv, size_t 
nargs_)
   {
     SCM *base;
 
-    /* Check that we have enough space: 4 words for the boot
-       continuation, 4 + nargs for the procedure application, and 4 for
+    /* Check that we have enough space: 3 words for the boot
+       continuation, 3 + nargs for the procedure application, and 3 for
        setting up a new frame.  */
     base = vp->sp + 1;
-    CHECK_OVERFLOW (vp->sp + 4 + 4 + nargs_ + 4);
+    CHECK_OVERFLOW (vp->sp + 3 + 3 + nargs_ + 3);
 
     /* Since it's possible to receive the arguments on the stack itself,
        and indeed the regular VM invokes us that way, shuffle up the
@@ -458,24 +457,22 @@ RTL_VM_NAME (SCM vm, SCM program, SCM *argv, size_t 
nargs_)
     {
       int i;
       for (i = nargs_ - 1; i >= 0; i--)
-        base[8 + i] = argv[i];
+        base[6 + i] = argv[i];
     }
 
     /* Initial frame, saving previous fp and ip, with the boot
        continuation.  */
     base[0] = SCM_PACK (fp); /* dynamic link */
-    base[1] = SCM_PACK (0); /* the boot continuation does not return to scheme 
*/
-    base[2] = SCM_PACK (ip); /* ra */
-    base[3] = rtl_boot_continuation;
-    fp = &base[4];
+    base[1] = SCM_PACK (ip); /* ra */
+    base[2] = rtl_boot_continuation;
+    fp = &base[3];
     ip = (scm_t_uint32 *) rtl_boot_continuation_code;
 
     /* MV-call frame, function & arguments */
-    base[4] = SCM_PACK (fp); /* dynamic link */
-    base[5] = SCM_PACK (ip); /* in RTL programs, MVRA same as RA */
-    base[6] = SCM_PACK (ip); /* ra */
-    base[7] = program;
-    fp = vp->fp = &base[8];
+    base[3] = SCM_PACK (fp); /* dynamic link */
+    base[4] = SCM_PACK (ip); /* ra */
+    base[5] = program;
+    fp = vp->fp = &base[6];
     RESET_FRAME (nargs_ + 1);
   }
 
@@ -525,20 +522,20 @@ RTL_VM_NAME (SCM vm, SCM program, SCM *argv, size_t 
nargs_)
    */
   VM_DEFINE_OP (0, halt, "halt", OP1 (U8_X24))
     {
-      scm_t_uint32 nvals = FRAME_LOCALS_COUNT() - 5;
+      scm_t_uint32 nvals = FRAME_LOCALS_COUNT() - 4;
       SCM ret;
 
-      /* Boot closure in r0, empty frame in r1/r2/r3, proc in r4, values from 
r5.  */
+      /* Boot closure in r0, empty frame in r1/r2, proc in r3, values from r4. 
 */
 
       if (nvals == 1)
-        ret = LOCAL_REF (5);
+        ret = LOCAL_REF (4);
       else
         {
           scm_t_uint32 n;
           ret = SCM_EOL;
           SYNC_BEFORE_GC();
           for (n = nvals; n > 0; n--)
-            ret = scm_cons (LOCAL_REF (5 + n - 1), ret);
+            ret = scm_cons (LOCAL_REF (4 + n - 1), ret);
           ret = scm_values (ret);
         }
 
@@ -574,7 +571,6 @@ RTL_VM_NAME (SCM vm, SCM program, SCM *argv, size_t nargs_)
 
       fp = vp->fp = old_fp + proc;
       SCM_FRAME_SET_DYNAMIC_LINK (fp, old_fp);
-      SCM_FRAME_SET_RTL_MV_RETURN_ADDRESS (fp, ip + 2);
       SCM_FRAME_SET_RTL_RETURN_ADDRESS (fp, ip + 2);
 
       RESET_FRAME (nlocals);
@@ -711,13 +707,12 @@ RTL_VM_NAME (SCM vm, SCM program, SCM *argv, size_t 
nargs_)
       SCM *base = fp;
 
       VM_HANDLE_INTERRUPTS;
-      ip = SCM_FRAME_RTL_MV_RETURN_ADDRESS (fp);
+      ip = SCM_FRAME_RTL_RETURN_ADDRESS (fp);
       fp = vp->fp = SCM_FRAME_DYNAMIC_LINK (fp);
 
       /* Clear stack frame.  */
       base[-2] = SCM_BOOL_F;
       base[-3] = SCM_BOOL_F;
-      base[-4] = SCM_BOOL_F;
 
       POP_CONTINUATION_HOOK (base, nvalues);
 
@@ -954,7 +949,6 @@ RTL_VM_NAME (SCM vm, SCM program, SCM *argv, size_t nargs_)
                                         SCM_FRAME_DYNAMIC_LINK (fp),
                                         SCM_FRAME_LOWER_ADDRESS (fp) - 1,
                                         SCM_FRAME_RETURN_ADDRESS (fp),
-                                        SCM_FRAME_MV_RETURN_ADDRESS (fp),
                                         dynstack,
                                         0);
       /* FIXME: Seems silly to capture the registers here, when they are
diff --git a/libguile/vm.c b/libguile/vm.c
index 5b32639..9550f81 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -104,8 +104,7 @@ scm_i_vm_cont_print (SCM x, SCM port, scm_print_state 
*pstate)
  */
 SCM
 scm_i_vm_capture_stack (SCM *stack_base, SCM *fp, SCM *sp, scm_t_uint8 *ra,
-                        scm_t_uint8 *mvra, scm_t_dynstack *dynstack,
-                        scm_t_uint32 flags)
+                        scm_t_dynstack *dynstack, scm_t_uint32 flags)
 {
   struct scm_vm_cont *p;
 
@@ -123,7 +122,6 @@ scm_i_vm_capture_stack (SCM *stack_base, SCM *fp, SCM *sp, 
scm_t_uint8 *ra,
   memset (p->stack_base, 0, p->stack_size * sizeof (SCM));
 #endif
   p->ra = ra;
-  p->mvra = mvra;
   p->sp = sp;
   p->fp = fp;
   memcpy (p->stack_base, stack_base, (sp + 1 - stack_base) * sizeof (SCM));
@@ -146,11 +144,7 @@ vm_return_to_continuation (SCM vm, SCM cont, size_t n, SCM 
*argv)
   vp = SCM_VM_DATA (vm);
   cp = SCM_VM_CONT_DATA (cont);
 
-  if (n == 0 && !cp->mvra)
-    scm_misc_error (NULL, "Too few values returned to continuation",
-                    SCM_EOL);
-
-  if (vp->stack_size < cp->stack_size + n + 4)
+  if (vp->stack_size < cp->stack_size + n + 3)
     scm_misc_error ("vm-engine", "not enough space to reinstate continuation",
                     scm_list_2 (vm, cont));
 
@@ -171,7 +165,7 @@ vm_return_to_continuation (SCM vm, SCM cont, size_t n, SCM 
*argv)
     size_t i;
 
     /* Push on an empty frame, as the continuation expects.  */
-    for (i = 0; i < 4; i++)
+    for (i = 0; i < 3; i++)
       {
         vp->sp++;
         *vp->sp = SCM_BOOL_F;
@@ -183,7 +177,7 @@ vm_return_to_continuation (SCM vm, SCM cont, size_t n, SCM 
*argv)
         vp->sp++;
         *vp->sp = argv_copy[i];
       }
-    vp->ip = cp->mvra;
+    vp->ip = cp->ra;
   }
 }
 
@@ -198,7 +192,7 @@ scm_i_capture_current_stack (void)
   vm = scm_the_vm ();
   vp = SCM_VM_DATA (vm);
 
-  return scm_i_vm_capture_stack (vp->stack_base, vp->fp, vp->sp, vp->ip, NULL,
+  return scm_i_vm_capture_stack (vp->stack_base, vp->fp, vp->sp, vp->ip,
                                  scm_dynstack_capture_all (&thread->dynstack),
                                  0);
 }
@@ -342,19 +336,14 @@ vm_reinstate_partial_continuation (SCM vm, SCM cont, 
size_t n, SCM *argv,
 
   vp->sp = base - 1 + cp->stack_size;
   vp->fp = RELOC (cp->fp);
-  vp->ip = cp->mvra;
+  vp->ip = cp->ra;
 
-  /* now push args. ip is in a MV context. */
+  /* Push the arguments. */
   for (i = 0; i < n; i++)
     {
       vp->sp++;
       *vp->sp = argv_copy[i];
     }
-#if 0
-  /* The number-of-values marker, only used by the stack VM.  */
-  vp->sp++;
-  *vp->sp = scm_from_size_t (n);
-#endif
 
   /* The prompt captured a slice of the dynamic stack.  Here we wind
      those entries onto the current thread's stack.  We also have to
diff --git a/libguile/vm.h b/libguile/vm.h
index 80423ec..7012eef 100644
--- a/libguile/vm.h
+++ b/libguile/vm.h
@@ -88,7 +88,7 @@ SCM_API void scm_c_set_default_vm_engine_x (int engine);
 struct scm_vm_cont {
   SCM *sp;
   SCM *fp;
-  scm_t_uint8 *ra, *mvra;
+  scm_t_uint8 *ra;
   scm_t_ptrdiff stack_size;
   SCM *stack_base;
   scm_t_ptrdiff reloc;
@@ -110,7 +110,7 @@ SCM_INTERNAL void scm_i_vm_print (SCM x, SCM port,
 SCM_INTERNAL SCM scm_i_call_with_current_continuation (SCM proc);
 SCM_INTERNAL SCM scm_i_capture_current_stack (void);
 SCM_INTERNAL SCM scm_i_vm_capture_stack (SCM *stack_base, SCM *fp, SCM *sp,
-                                         scm_t_uint8 *ra, scm_t_uint8 *mvra,
+                                         scm_t_uint8 *ra,
                                          scm_t_dynstack *dynstack,
                                          scm_t_uint32 flags);
 SCM_INTERNAL void scm_i_vm_cont_print (SCM x, SCM port,
diff --git a/module/language/cps/slot-allocation.scm 
b/module/language/cps/slot-allocation.scm
index 066b42d..ba83982 100644
--- a/module/language/cps/slot-allocation.scm
+++ b/module/language/cps/slot-allocation.scm
@@ -258,7 +258,7 @@ are comparable with eqv?.  A tmp slot may be used."
           (find-first-zero live-slots)))
 
     (define (compute-call-proc-slot live-slots)
-      (+ 3 (find-first-trailing-zero live-slots)))
+      (+ 2 (find-first-trailing-zero live-slots)))
 
     (define (compute-prompt-handler-proc-slot live-slots)
       (1- (find-first-trailing-zero live-slots)))
diff --git a/module/system/vm/assembler.scm b/module/system/vm/assembler.scm
index 3ba25b3..01fac65 100644
--- a/module/system/vm/assembler.scm
+++ b/module/system/vm/assembler.scm
@@ -701,11 +701,9 @@ returned instead."
 ;(define-tc7-macro-assembler br-if-fluid 37)
 ;(define-tc7-macro-assembler br-if-dynamic-state 45)
 ;(define-tc7-macro-assembler br-if-frame 47)
-;(define-tc7-macro-assembler br-if-objcode 53)
 ;(define-tc7-macro-assembler br-if-vm 55)
 ;(define-tc7-macro-assembler br-if-vm-cont 71)
 ;(define-tc7-macro-assembler br-if-rtl-program 69)
-;(define-tc7-macro-assembler br-if-program 79)
 ;(define-tc7-macro-assembler br-if-weak-set 85)
 ;(define-tc7-macro-assembler br-if-weak-table 87)
 ;(define-tc7-macro-assembler br-if-array 93)
@@ -1202,7 +1200,7 @@ needed."
 
 ;; FIXME: Define these somewhere central, shared with C.
 (define *bytecode-major-version* #x0202)
-(define *bytecode-minor-version* 2)
+(define *bytecode-minor-version* 3)
 
 (define (link-dynamic-section asm text rw rw-init)
   "Link the dynamic section for an ELF image with RTL text, given the


hooks/post-receive
-- 
GNU Guile



reply via email to

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