[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 21/25: Remove pair-related instructions
From: |
Andy Wingo |
Subject: |
[Guile-commits] 21/25: Remove pair-related instructions |
Date: |
Mon, 8 Jan 2018 09:25:05 -0500 (EST) |
wingo pushed a commit to branch master
in repository guile.
commit 798f6336246305554567f10e1561ed6545640545
Author: Andy Wingo <address@hidden>
Date: Sun Jan 7 18:32:07 2018 +0100
Remove pair-related instructions
* libguile/vm-engine.c (VM_VALIDATE_PAIR, VM_VALIDATE_MUTABLE_PAIR):
Remove these now-unused definitions.
(VM_VALIDATE_VECTOR, VM_VALIDATE_MUTABLE_VECTOR): Likewise.
(cons, car, cdr, set-car!, set-cdr!): Remove instructions.
* libguile/vm.c (vm_error_not_a_pair, vm_error_not_a_mutable_pair):
Remove unused error cases.
---
libguile/vm-engine.c | 83 +++++-----------------------------------------------
libguile/vm.c | 14 ---------
2 files changed, 7 insertions(+), 90 deletions(-)
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c
index 5205550..997fdcc 100644
--- a/libguile/vm-engine.c
+++ b/libguile/vm-engine.c
@@ -321,20 +321,12 @@
VM_VALIDATE (obj, SCM_MUTABLE_BYTEVECTOR_P, proc, mutable_bytevector)
#define VM_VALIDATE_CHAR(x, proc) \
VM_VALIDATE (x, SCM_CHARP, proc, char)
-#define VM_VALIDATE_PAIR(x, proc) \
- VM_VALIDATE (x, scm_is_pair, proc, pair)
-#define VM_VALIDATE_MUTABLE_PAIR(x, proc) \
- VM_VALIDATE (x, scm_is_mutable_pair, proc, mutable_pair)
#define VM_VALIDATE_STRING(obj, proc) \
VM_VALIDATE (obj, scm_is_string, proc, string)
#define VM_VALIDATE_STRUCT(obj, proc) \
VM_VALIDATE (obj, SCM_STRUCTP, proc, struct)
#define VM_VALIDATE_VARIABLE(obj, proc) \
VM_VALIDATE (obj, SCM_VARIABLEP, proc, variable)
-#define VM_VALIDATE_VECTOR(obj, proc) \
- VM_VALIDATE (obj, SCM_I_IS_VECTOR, proc, vector)
-#define VM_VALIDATE_MUTABLE_VECTOR(obj, proc) \
- VM_VALIDATE (obj, SCM_I_IS_MUTABLE_VECTOR, proc, mutable_vector)
#define VM_VALIDATE_INDEX(u64, size, proc) \
VM_ASSERT (u64 < size, vm_error_out_of_range_uint64 (proc, u64))
@@ -2231,76 +2223,16 @@ VM_NAME (scm_i_thread *thread, struct scm_vm *vp,
- /*
- * Pairs
- */
-
- /* cons dst:8 car:8 cdr:8
- *
- * Cons CAR and CDR, and store the result in DST.
- */
- VM_DEFINE_OP (81, cons, "cons", OP1 (X8_S8_S8_S8) | OP_DST)
- {
- ARGS2 (x, y);
- SYNC_IP ();
- RETURN (scm_inline_cons (thread, x, y));
- }
-
- /* car dst:12 src:12
- *
- * Place the car of SRC in DST.
- */
- VM_DEFINE_OP (82, car, "car", OP1 (X8_S12_S12) | OP_DST)
- {
- ARGS1 (x);
- VM_VALIDATE_PAIR (x, "car");
- RETURN (SCM_CAR (x));
- }
-
- /* cdr dst:12 src:12
- *
- * Place the cdr of SRC in DST.
- */
- VM_DEFINE_OP (83, cdr, "cdr", OP1 (X8_S12_S12) | OP_DST)
- {
- ARGS1 (x);
- VM_VALIDATE_PAIR (x, "cdr");
- RETURN (SCM_CDR (x));
- }
-
- /* set-car! pair:12 car:12
- *
- * Set the car of DST to SRC.
- */
- VM_DEFINE_OP (84, set_car, "set-car!", OP1 (X8_S12_S12))
+ VM_DEFINE_OP (81, unused_81, NULL, NOP)
+ VM_DEFINE_OP (82, unused_82, NULL, NOP)
+ VM_DEFINE_OP (83, unused_83, NULL, NOP)
+ VM_DEFINE_OP (84, unused_84, NULL, NOP)
+ VM_DEFINE_OP (85, unused_85, NULL, NOP)
{
- scm_t_uint16 a, b;
- SCM x, y;
- UNPACK_12_12 (op, a, b);
- x = SP_REF (a);
- y = SP_REF (b);
- VM_VALIDATE_MUTABLE_PAIR (x, "set-car!");
- SCM_SETCAR (x, y);
- NEXT (1);
- }
-
- /* set-cdr! pair:12 cdr:12
- *
- * Set the cdr of DST to SRC.
- */
- VM_DEFINE_OP (85, set_cdr, "set-cdr!", OP1 (X8_S12_S12))
- {
- scm_t_uint16 a, b;
- SCM x, y;
- UNPACK_12_12 (op, a, b);
- x = SP_REF (a);
- y = SP_REF (b);
- VM_VALIDATE_MUTABLE_PAIR (x, "set-cdr!");
- SCM_SETCDR (x, y);
- NEXT (1);
+ vm_error_bad_instruction (op);
+ abort (); /* never reached */
}
-
/*
@@ -4367,7 +4299,6 @@ VM_NAME (scm_i_thread *thread, struct scm_vm *vp,
#undef VM_USE_HOOKS
#undef VM_VALIDATE_ATOMIC_BOX
#undef VM_VALIDATE_BYTEVECTOR
-#undef VM_VALIDATE_PAIR
#undef VM_VALIDATE_STRUCT
/*
diff --git a/libguile/vm.c b/libguile/vm.c
index 6b904cf..feed5c8 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -433,8 +433,6 @@ static void vm_error_kwargs_unrecognized_keyword (SCM proc,
SCM kw) SCM_NORETURN
static void vm_error_wrong_num_args (SCM proc) SCM_NORETURN SCM_NOINLINE;
static void vm_error_wrong_type_apply (SCM proc) SCM_NORETURN SCM_NOINLINE;
static void vm_error_not_a_char (const char *subr, SCM x) SCM_NORETURN
SCM_NOINLINE;
-static void vm_error_not_a_pair (const char *subr, SCM x) SCM_NORETURN
SCM_NOINLINE;
-static void vm_error_not_a_mutable_pair (const char *subr, SCM x) SCM_NORETURN
SCM_NOINLINE;
static void vm_error_not_a_string (const char *subr, SCM x) SCM_NORETURN
SCM_NOINLINE;
static void vm_error_not_a_atomic_box (const char *subr, SCM x) SCM_NORETURN
SCM_NOINLINE;
static void vm_error_not_a_bytevector (const char *subr, SCM x) SCM_NORETURN
SCM_NOINLINE;
@@ -564,18 +562,6 @@ vm_error_not_a_char (const char *subr, SCM x)
}
static void
-vm_error_not_a_pair (const char *subr, SCM x)
-{
- scm_wrong_type_arg_msg (subr, 1, x, "pair");
-}
-
-static void
-vm_error_not_a_mutable_pair (const char *subr, SCM x)
-{
- scm_wrong_type_arg_msg (subr, 1, x, "mutable pair");
-}
-
-static void
vm_error_not_a_string (const char *subr, SCM x)
{
scm_wrong_type_arg_msg (subr, 1, x, "string");
- [Guile-commits] branch master updated (fa4cb21 -> e2a0624), Andy Wingo, 2018/01/08
- [Guile-commits] 05/25: Minor optimization in loop peeling, Andy Wingo, 2018/01/08
- [Guile-commits] 03/25: Bug-fix to devirtualize-integers pass, Andy Wingo, 2018/01/08
- [Guile-commits] 07/25: Instruction explosion for make-vector, Andy Wingo, 2018/01/08
- [Guile-commits] 11/25: Remove "ash" instruction., Andy Wingo, 2018/01/08
- [Guile-commits] 09/25: Mark word-ref and word-ref/immediate as producing U64 values, Andy Wingo, 2018/01/08
- [Guile-commits] 12/25: Remove now-unused make-vector et al instructions, Andy Wingo, 2018/01/08
- [Guile-commits] 18/25: Minor compile-cps refactor for cons, Andy Wingo, 2018/01/08
- [Guile-commits] 15/25: CPS type analysis support for mutable vs immutable vectors, Andy Wingo, 2018/01/08
- [Guile-commits] 21/25: Remove pair-related instructions,
Andy Wingo <=
- [Guile-commits] 10/25: CPS pass now expects exploded vector primitives, Andy Wingo, 2018/01/08
- [Guile-commits] 13/25: Add CPS compilation support for mutable-vector?, Andy Wingo, 2018/01/08
- [Guile-commits] 24/25: Sync IP before allocating closures, Andy Wingo, 2018/01/08
- [Guile-commits] 19/25: Expand pair-related primcalls, Andy Wingo, 2018/01/08
- [Guile-commits] 16/25: Re-add compiler backend support for immutable vectors, Andy Wingo, 2018/01/08
- [Guile-commits] 25/25: Save VM compare result before calling out to hooks, Andy Wingo, 2018/01/08
- [Guile-commits] 01/25: Fix verify.scm for call-thunk/no-inline, Andy Wingo, 2018/01/08
- [Guile-commits] 22/25: Better compilation of vector constructors and initializers, Andy Wingo, 2018/01/08
- [Guile-commits] 08/25: Instruction explosion for /immediate variants of vector prims, Andy Wingo, 2018/01/08
- [Guile-commits] 06/25: Fix primitive reification for scm-set! / word-set!., Andy Wingo, 2018/01/08