1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00

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.
This commit is contained in:
Andy Wingo 2018-04-13 10:15:04 +02:00
parent dff85f6f9f
commit 0ae3d62f40
2 changed files with 2 additions and 72 deletions

View file

@ -321,12 +321,6 @@
RETURN_EXP (SFUNC (x, y)); \ 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. */ /* Return true (non-zero) if PTR has suitable alignment for TYPE. */
#define ALIGNED_P(ptr, type) \ #define ALIGNED_P(ptr, type) \
((scm_t_uintptr) (ptr) % alignof_type (type) == 0) ((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) 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) 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) 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) 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) VM_DEFINE_OP (182, unused_182, NULL, NOP)
{ {
scm_t_uint16 dst, box; vm_error_bad_instruction (op);
scm_t_uint32 expected, desired; abort (); /* never reached */
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);
} }
/* handle-interrupts _:24 /* handle-interrupts _:24
@ -3707,7 +3645,6 @@ VM_NAME (scm_i_thread *thread, struct scm_vm *vp,
#undef VM_DEFINE_OP #undef VM_DEFINE_OP
#undef VM_INSTRUCTION_TO_LABEL #undef VM_INSTRUCTION_TO_LABEL
#undef VM_USE_HOOKS #undef VM_USE_HOOKS
#undef VM_VALIDATE_ATOMIC_BOX
/* /*
(defun renumber-ops () (defun renumber-ops ()

View file

@ -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_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_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_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_no_values (void) SCM_NORETURN SCM_NOINLINE;
static void vm_error_not_enough_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; static void vm_error_wrong_number_of_values (scm_t_uint32 expected) SCM_NORETURN SCM_NOINLINE;
@ -543,12 +542,6 @@ vm_error_wrong_type_apply (SCM proc)
scm_list_1 (proc), scm_list_1 (proc)); scm_list_1 (proc), scm_list_1 (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 static void
vm_error_no_values (void) vm_error_no_values (void)
{ {