mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-24 04:15:36 +02:00
Unbox indexes of vectors, strings, and structs
* libguile/vm-engine.c (string-length, string-ref) (make-vector, vector-ref, vector-set!) (allocate-struct, struct-ref, struct-set!): Take indexes and return lengths as untagged u64 values. * libguile/vm.c (vm_error_not_a_string): New helper. * module/language/tree-il/compile-cps.scm (convert): * module/language/cps/constructors.scm (inline-vector): * module/language/cps/closure-conversion.scm (convert-one): Untag arguments to {string,vector,struct}-{ref,set!}, make-vector, and allocate-struct. Tag return values from {string,vector}-length. * module/language/cps/slot-allocation.scm (compute-var-representations): vector-length and string-length define u64 slots. * module/language/cps/effects-analysis.scm: make-vector no longer causes a &type-check effect. * module/language/cps/types.scm: Update to expect &u64 values for lengths and indexes.
This commit is contained in:
parent
a08b3d40f8
commit
c3240d09b2
8 changed files with 193 additions and 116 deletions
|
@ -443,6 +443,7 @@ static void vm_error_wrong_type_apply (SCM proc) SCM_NORETURN SCM_NOINLINE;
|
|||
static void vm_error_stack_underflow (void) SCM_NORETURN SCM_NOINLINE;
|
||||
static void vm_error_improper_list (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_string (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;
|
||||
static void vm_error_not_a_struct (const char *subr, SCM x) SCM_NORETURN SCM_NOINLINE;
|
||||
static void vm_error_not_a_vector (const char *subr, SCM v) SCM_NORETURN SCM_NOINLINE;
|
||||
|
@ -561,6 +562,12 @@ 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_string (const char *subr, SCM x)
|
||||
{
|
||||
scm_wrong_type_arg_msg (subr, 1, x, "string");
|
||||
}
|
||||
|
||||
static void
|
||||
vm_error_not_a_bytevector (const char *subr, SCM x)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue