guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] 03/03: Remove box instructions


From: Andy Wingo
Subject: [Guile-commits] 03/03: Remove box instructions
Date: Wed, 10 Jan 2018 02:03:39 -0500 (EST)

wingo pushed a commit to branch master
in repository guile.

commit 02e52a4118683cf3b1cd43edd3a2c2620c7dd414
Author: Andy Wingo <address@hidden>
Date:   Wed Jan 10 07:45:47 2018 +0100

    Remove box instructions
    
    * libguile/vm-engine.c (box, box-ref, box-set!): Remove these
      instructions.
    * module/system/vm/assembler.scm: Remove assemblers for box-ref et al.
    * libguile/vm.c (vm_error_not_a_variable): Remove unused function.
---
 libguile/vm-engine.c           | 48 +++++-------------------------------------
 libguile/vm.c                  |  8 -------
 module/system/vm/assembler.scm |  3 ---
 3 files changed, 5 insertions(+), 54 deletions(-)

diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c
index a47e1b1..83eefd8 100644
--- a/libguile/vm-engine.c
+++ b/libguile/vm-engine.c
@@ -1488,50 +1488,12 @@ VM_NAME (scm_i_thread *thread, struct scm_vm *vp,
       NEXT (2);
     }
 
-  /* box dst:12 src:12
-   *
-   * Create a new variable holding SRC, and place it in DST.
-   */
-  VM_DEFINE_OP (51, box, "box", OP1 (X8_S12_S12) | OP_DST)
-    {
-      scm_t_uint16 dst, src;
-      UNPACK_12_12 (op, dst, src);
-      SYNC_IP ();
-      SP_SET (dst, scm_inline_cell (thread, scm_tc7_variable,
-                                       SCM_UNPACK (SP_REF (src))));
-      NEXT (1);
-    }
-
-  /* box-ref dst:12 src:12
-   *
-   * Unpack the variable at SRC into DST, asserting that the variable is
-   * actually bound.
-   */
-  VM_DEFINE_OP (52, box_ref, "box-ref", OP1 (X8_S12_S12) | OP_DST)
-    {
-      scm_t_uint16 dst, src;
-      SCM var;
-      UNPACK_12_12 (op, dst, src);
-      var = SP_REF (src);
-      VM_VALIDATE_VARIABLE (var, "variable-ref");
-      VM_ASSERT (VARIABLE_BOUNDP (var), vm_error_unbound (var));
-      SP_SET (dst, VARIABLE_REF (var));
-      NEXT (1);
-    }
-
-  /* box-set! dst:12 src:12
-   *
-   * Set the contents of the variable at DST to SET.
-   */
-  VM_DEFINE_OP (53, box_set, "box-set!", OP1 (X8_S12_S12))
+  VM_DEFINE_OP (51, unused_51, NULL, NOP)
+  VM_DEFINE_OP (52, unused_52, NULL, NOP)
+  VM_DEFINE_OP (53, unused_53, NULL, NOP)
     {
-      scm_t_uint16 dst, src;
-      SCM var;
-      UNPACK_12_12 (op, dst, src);
-      var = SP_REF (dst);
-      VM_VALIDATE_VARIABLE (var, "variable-set!");
-      VARIABLE_SET (var, SP_REF (src));
-      NEXT (1);
+      vm_error_bad_instruction (op);
+      abort (); /* never reached */
     }
 
   /* make-closure dst:24 offset:32 _:8 nfree:24
diff --git a/libguile/vm.c b/libguile/vm.c
index 5292055..2f99692 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -429,7 +429,6 @@ static void vm_throw_with_value_and_data (SCM val, SCM 
key_subr_and_message) SCM
 static void vm_error (const char *msg, SCM arg) SCM_NORETURN;
 static void vm_error_bad_instruction (scm_t_uint32 inst) SCM_NORETURN 
SCM_NOINLINE;
 static void vm_error_unbound (SCM sym) SCM_NORETURN SCM_NOINLINE;
-static void vm_error_not_a_variable (const char *func_name, SCM x) 
SCM_NORETURN SCM_NOINLINE;
 static void vm_error_apply_to_non_list (SCM x) SCM_NORETURN SCM_NOINLINE;
 static void vm_error_kwargs_missing_value (SCM proc, SCM kw) SCM_NORETURN 
SCM_NOINLINE;
 static void vm_error_kwargs_invalid_keyword (SCM proc, SCM obj) SCM_NORETURN 
SCM_NOINLINE;
@@ -509,13 +508,6 @@ vm_error_unbound (SCM sym)
 }
 
 static void
-vm_error_not_a_variable (const char *func_name, SCM x)
-{
-  scm_error (scm_arg_type_key, func_name, "Not a variable: ~S",
-             scm_list_1 (x), scm_list_1 (x));
-}
-
-static void
 vm_error_apply_to_non_list (SCM x)
 {
   scm_error (scm_arg_type_key, "apply", "Apply to non-list: ~S",
diff --git a/module/system/vm/assembler.scm b/module/system/vm/assembler.scm
index 66555fe..77b2e51 100644
--- a/module/system/vm/assembler.scm
+++ b/module/system/vm/assembler.scm
@@ -173,9 +173,6 @@
             emit-assert-nargs-ee/locals
             emit-bind-kwargs
             emit-bind-rest
-            emit-box
-            emit-box-ref
-            emit-box-set!
             emit-make-closure
             emit-free-ref
             emit-free-set!



reply via email to

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