[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 14/15: Remove implementation of atomic box ops
From: |
Andy Wingo |
Subject: |
[Guile-commits] 14/15: Remove implementation of atomic box ops |
Date: |
Fri, 13 Apr 2018 04:41:13 -0400 (EDT) |
wingo pushed a commit to branch master
in repository guile.
commit 0ae3d62f40f35dde06c6020ee36afb2bc4053ccf
Author: Andy Wingo <address@hidden>
Date: Fri Apr 13 10:15:04 2018 +0200
Remove implementation of atomic box ops
* libguile/vm-engine.c (VM_VALIDATE, VM_VALIDATE_ATOMIC_BOX): Remove
now-unused definitions. Remove implementations of atomic-box-ref et
al.
* libguile/vm.c (vm_error_not_a_atomic_box): Remove.
---
libguile/vm-engine.c | 67 ++--------------------------------------------------
libguile/vm.c | 7 ------
2 files changed, 2 insertions(+), 72 deletions(-)
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c
index 8f06c57..7640b96 100644
--- a/libguile/vm-engine.c
+++ b/libguile/vm-engine.c
@@ -321,12 +321,6 @@
RETURN_EXP (SFUNC (x, y)); \
}
-#define VM_VALIDATE(x, pred, proc, what) \
- VM_ASSERT (pred (x), vm_error_not_a_ ## what (proc, x))
-
-#define VM_VALIDATE_ATOMIC_BOX(x, proc) \
- VM_VALIDATE (x, scm_is_atomic_box, proc, atomic_box)
-
/* Return true (non-zero) if PTR has suitable alignment for TYPE. */
#define ALIGNED_P(ptr, type) \
((scm_t_uintptr) (ptr) % alignof_type (type) == 0)
@@ -2769,69 +2763,13 @@ VM_NAME (scm_i_thread *thread, struct scm_vm *vp,
}
VM_DEFINE_OP (178, unused_178, NULL, NOP)
- {
- SCM box;
- scm_t_uint16 dst, src;
- UNPACK_12_12 (op, dst, src);
- SYNC_IP ();
- box = scm_inline_cell (thread, scm_tc7_atomic_box,
- SCM_UNPACK (SCM_UNSPECIFIED));
- scm_atomic_set_scm (scm_atomic_box_loc (box), SP_REF (src));
- SP_SET (dst, box);
- NEXT (1);
- }
-
VM_DEFINE_OP (179, unused_179, NULL, NOP)
- {
- scm_t_uint16 dst, src;
- SCM box;
- UNPACK_12_12 (op, dst, src);
- box = SP_REF (src);
- VM_VALIDATE_ATOMIC_BOX (box, "atomic-box-ref");
- SP_SET (dst, scm_atomic_ref_scm (scm_atomic_box_loc (box)));
- NEXT (1);
- }
-
VM_DEFINE_OP (180, unused_180, NULL, NOP)
- {
- scm_t_uint16 dst, src;
- SCM box;
- UNPACK_12_12 (op, dst, src);
- box = SP_REF (dst);
- VM_VALIDATE_ATOMIC_BOX (box, "atomic-box-set!");
- scm_atomic_set_scm (scm_atomic_box_loc (box), SP_REF (src));
- NEXT (1);
- }
-
VM_DEFINE_OP (181, unused_181, NULL, NOP)
- {
- scm_t_uint16 dst, box;
- scm_t_uint32 val;
- SCM scm_box;
- UNPACK_12_12 (op, dst, box);
- UNPACK_24 (ip[1], val);
- scm_box = SP_REF (box);
- VM_VALIDATE_ATOMIC_BOX (scm_box, "atomic-box-swap!");
- SP_SET (dst,
- scm_atomic_swap_scm (scm_atomic_box_loc (scm_box), SP_REF
(val)));
- NEXT (2);
- }
-
VM_DEFINE_OP (182, unused_182, NULL, NOP)
{
- scm_t_uint16 dst, box;
- scm_t_uint32 expected, desired;
- SCM scm_box, scm_expected;
- UNPACK_12_12 (op, dst, box);
- UNPACK_24 (ip[1], expected);
- UNPACK_24 (ip[2], desired);
- scm_box = SP_REF (box);
- VM_VALIDATE_ATOMIC_BOX (scm_box, "atomic-box-compare-and-swap!");
- scm_expected = SP_REF (expected);
- scm_atomic_compare_and_swap_scm (scm_atomic_box_loc (scm_box),
- &scm_expected, SP_REF (desired));
- SP_SET (dst, scm_expected);
- NEXT (3);
+ vm_error_bad_instruction (op);
+ abort (); /* never reached */
}
/* handle-interrupts _:24
@@ -3707,7 +3645,6 @@ VM_NAME (scm_i_thread *thread, struct scm_vm *vp,
#undef VM_DEFINE_OP
#undef VM_INSTRUCTION_TO_LABEL
#undef VM_USE_HOOKS
-#undef VM_VALIDATE_ATOMIC_BOX
/*
(defun renumber-ops ()
diff --git a/libguile/vm.c b/libguile/vm.c
index 3129fcb..7ebebd1 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -436,7 +436,6 @@ static void vm_error_kwargs_invalid_keyword (SCM proc, SCM
obj) SCM_NORETURN SCM
static void vm_error_kwargs_unrecognized_keyword (SCM proc, SCM kw)
SCM_NORETURN SCM_NOINLINE;
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_atomic_box (const char *subr, SCM x) SCM_NORETURN
SCM_NOINLINE;
static void vm_error_no_values (void) SCM_NORETURN SCM_NOINLINE;
static void vm_error_not_enough_values (void) SCM_NORETURN SCM_NOINLINE;
static void vm_error_wrong_number_of_values (scm_t_uint32 expected)
SCM_NORETURN SCM_NOINLINE;
@@ -544,12 +543,6 @@ vm_error_wrong_type_apply (SCM proc)
}
static void
-vm_error_not_a_atomic_box (const char *subr, SCM x)
-{
- scm_wrong_type_arg_msg (subr, 1, x, "atomic box");
-}
-
-static void
vm_error_no_values (void)
{
vm_error ("Zero values returned to single-valued continuation",
- [Guile-commits] 04/15: Instruction explosion for f64->scm, (continued)
- [Guile-commits] 04/15: Instruction explosion for f64->scm, Andy Wingo, 2018/04/13
- [Guile-commits] 03/15: Add reifier for fadd/immediate., Andy Wingo, 2018/04/13
- [Guile-commits] 02/15: Slim heap-allocated flonums, Andy Wingo, 2018/04/13
- [Guile-commits] 01/15: Add scm->f64 intrinsic, Andy Wingo, 2018/04/13
- [Guile-commits] 11/15: logsub is intrinsic, Andy Wingo, 2018/04/13
- [Guile-commits] 09/15: u64->scm, s64->scm intrinsics, Andy Wingo, 2018/04/13
- [Guile-commits] 08/15: Remove scm->u64, etc implementations, Andy Wingo, 2018/04/13
- [Guile-commits] 10/15: Remove implementations of obsolete s64->scm, u64->scm insts, Andy Wingo, 2018/04/13
- [Guile-commits] 12/15: Remove implementation of logsub VM op, Andy Wingo, 2018/04/13
- [Guile-commits] 07/15: scm->u64, scm->s64, scm->u64/truncate intrinsics, Andy Wingo, 2018/04/13
- [Guile-commits] 14/15: Remove implementation of atomic box ops,
Andy Wingo <=
- [Guile-commits] 13/15: Explode atomic box ops to new atomic instructions, Andy Wingo, 2018/04/13
- [Guile-commits] 15/15: Remove unused macros in vm-engine, Andy Wingo, 2018/04/13