mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-14 15:40:19 +02:00
allow compilation of #@2(1 2 3)
* libguile/arrays.h: * libguile/arrays.c (scm_from_contiguous_array): New public function, like scm_from_contiguous_typed_array but for arrays of generic Scheme values. * libguile/vm-i-scheme.c (make-struct): Sync regs before making the struct, so if we get a GC the regs are on the heap. (make-array): New instruction, makes an generic (untyped) Scheme array. * module/language/glil/compile-assembly.scm (dump-object): Correctly compile arrays.
This commit is contained in:
parent
5a9c6dcbb3
commit
73788ca8be
4 changed files with 71 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2001, 2009 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2001, 2009, 2010 Free Software Foundation, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
|
@ -651,10 +651,26 @@ VM_DEFINE_INSTRUCTION (176, make_struct, "make-struct", 2, -1, 1)
|
|||
|
||||
sp -= n_args - 1;
|
||||
|
||||
SYNC_REGISTER ();
|
||||
RETURN (scm_c_make_structv (vtable, scm_to_size_t (n_tail),
|
||||
n_args - 2, (scm_t_bits *) inits));
|
||||
}
|
||||
|
||||
VM_DEFINE_INSTRUCTION (177, make_array, "make-array", 3, -1, 1)
|
||||
{
|
||||
scm_t_uint32 len;
|
||||
SCM shape, ret;
|
||||
|
||||
len = FETCH ();
|
||||
len = (len << 8) + FETCH ();
|
||||
len = (len << 8) + FETCH ();
|
||||
POP (shape);
|
||||
SYNC_REGISTER ();
|
||||
ret = scm_from_contiguous_array (shape, sp - len + 1, len);
|
||||
DROPN (len);
|
||||
RETURN (ret);
|
||||
}
|
||||
|
||||
/*
|
||||
(defun renumber-ops ()
|
||||
"start from top of buffer and renumber 'VM_DEFINE_FOO (\n' sequences"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue