mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 22:31:12 +02:00
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.
This commit is contained in:
parent
24f998e4d2
commit
02e52a4118
3 changed files with 5 additions and 54 deletions
|
@ -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)
|
||||
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;
|
||||
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))
|
||||
{
|
||||
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
|
||||
|
|
|
@ -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;
|
||||
|
@ -508,13 +507,6 @@ vm_error_unbound (SCM sym)
|
|||
scm_list_1 (sym), SCM_BOOL_F);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -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!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue