mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 14:00:21 +02:00
Remove char->integer from VM
* libguile/vm-engine.c (VM_VALIDATE_CHAR, VM_VALIDATE_STRING) (VM_VALIDATE_INDEX): Remove now-unused helpers. (vm_engine): Fix position of intrinsics declaration. (char->integer): Remove unused opcode. * libguile/vm.c (vm_error_not_a_char, vm_error_not_a_string) (vm_error_out_of_range_uint64): Remove unused decls.
This commit is contained in:
parent
21d5897b4c
commit
644875cf0e
2 changed files with 3 additions and 48 deletions
|
@ -318,13 +318,6 @@
|
|||
|
||||
#define VM_VALIDATE_ATOMIC_BOX(x, proc) \
|
||||
VM_VALIDATE (x, scm_is_atomic_box, proc, atomic_box)
|
||||
#define VM_VALIDATE_CHAR(x, proc) \
|
||||
VM_VALIDATE (x, SCM_CHARP, proc, char)
|
||||
#define VM_VALIDATE_STRING(obj, proc) \
|
||||
VM_VALIDATE (obj, scm_is_string, proc, string)
|
||||
|
||||
#define VM_VALIDATE_INDEX(u64, size, proc) \
|
||||
VM_ASSERT (u64 < size, vm_error_out_of_range_uint64 (proc, u64))
|
||||
|
||||
/* Return true (non-zero) if PTR has suitable alignment for TYPE. */
|
||||
#define ALIGNED_P(ptr, type) \
|
||||
|
@ -346,6 +339,8 @@ VM_NAME (scm_i_thread *thread, struct scm_vm *vp,
|
|||
/* Current opcode: A cache of *ip. */
|
||||
register scm_t_uint32 op;
|
||||
|
||||
void **intrinsics = (void**) &scm_vm_intrinsics;
|
||||
|
||||
#ifdef HAVE_LABELS_AS_VALUES
|
||||
static const void *jump_table_[256] = {
|
||||
#define LABEL_ADDR(opcode, tag, name, meta) &&op_##tag,
|
||||
|
@ -358,8 +353,6 @@ VM_NAME (scm_i_thread *thread, struct scm_vm *vp,
|
|||
jump_table = jump_table_;
|
||||
#endif
|
||||
|
||||
void **intrinsics = (void**) &scm_vm_intrinsics;
|
||||
|
||||
/* Load VM registers. */
|
||||
CACHE_REGISTER ();
|
||||
|
||||
|
@ -2838,29 +2831,12 @@ VM_NAME (scm_i_thread *thread, struct scm_vm *vp,
|
|||
VM_DEFINE_OP (173, unused_173, NULL, NOP)
|
||||
VM_DEFINE_OP (174, unused_174, NULL, NOP)
|
||||
VM_DEFINE_OP (175, unused_175, NULL, NOP)
|
||||
VM_DEFINE_OP (176, unused_176, NULL, NOP)
|
||||
{
|
||||
vm_error_bad_instruction (op);
|
||||
abort (); /* never reached */
|
||||
}
|
||||
|
||||
/* char->integer a:12 b:12
|
||||
*
|
||||
* Untag the character in B to U64, and return it in A.
|
||||
*/
|
||||
VM_DEFINE_OP (176, char_to_integer, "char->integer", OP1 (X8_S12_S12) | OP_DST)
|
||||
{
|
||||
scm_t_uint16 dst, src;
|
||||
SCM x;
|
||||
|
||||
UNPACK_12_12 (op, dst, src);
|
||||
x = SP_REF (src);
|
||||
|
||||
VM_VALIDATE_CHAR (x, "char->integer");
|
||||
SP_SET_U64 (dst, SCM_CHAR (x));
|
||||
|
||||
NEXT (1);
|
||||
}
|
||||
|
||||
/* ulogxor dst:8 a:8 b:8
|
||||
*
|
||||
* Place the bitwise exclusive OR of the u64 values in A and B into
|
||||
|
|
|
@ -436,10 +436,7 @@ 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_char (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_out_of_range_uint64 (const char *subr, scm_t_uint64 idx) 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;
|
||||
|
@ -546,30 +543,12 @@ vm_error_wrong_type_apply (SCM proc)
|
|||
scm_list_1 (proc), scm_list_1 (proc));
|
||||
}
|
||||
|
||||
static void
|
||||
vm_error_not_a_char (const char *subr, SCM x)
|
||||
{
|
||||
scm_wrong_type_arg_msg (subr, 1, x, "char");
|
||||
}
|
||||
|
||||
static void
|
||||
vm_error_not_a_string (const char *subr, SCM x)
|
||||
{
|
||||
scm_wrong_type_arg_msg (subr, 1, x, "string");
|
||||
}
|
||||
|
||||
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_out_of_range_uint64 (const char *subr, scm_t_uint64 idx)
|
||||
{
|
||||
scm_out_of_range (subr, scm_from_uint64 (idx));
|
||||
}
|
||||
|
||||
static void
|
||||
vm_error_no_values (void)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue