mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-16 08:40:19 +02:00
move module and meta inside programs' object tables
* libguile/programs.h (struct scm_program): Remove the module and meta fields. * libguile/programs.c (scm_c_make_program): Add a new argument, `objs'. If it's a vector, we'll look for the module and the metadata in there, instead of having them in the scm_program structure. (scm_c_make_closure, program_mark, scm_program_meta) (scm_c_program_source, scm_program_module): Adapt to the new program representation. * libguile/objcodes.c (scm_objcode_to_program): Pass #f as the object table when making the program. * libguile/vm-engine.h (CACHE_PROGRAM): * libguile/vm-engine.c (vm_run): Rework to use the simple vector API for getting the current object table. Call the helper, vm_make_boot_program, to make the boot program. * libguile/vm-i-loader.c (load-program): Set the current module and the meta in the object vector, which we pass to scm_c_make_program. * libguile/vm-i-system.c (toplevel-ref, toplevel-set): Adapt to the new program representation. * module/language/glil/compile-objcode.scm (codegen): Clarify.
This commit is contained in:
parent
a72317988f
commit
2fda024221
9 changed files with 64 additions and 61 deletions
|
@ -163,17 +163,15 @@
|
|||
call `scm_vector_writable_elements ()' and the likes. */
|
||||
#define CACHE_PROGRAM() \
|
||||
{ \
|
||||
ssize_t _vincr; \
|
||||
\
|
||||
if (bp != SCM_PROGRAM_DATA (program)) { \
|
||||
bp = SCM_PROGRAM_DATA (program); \
|
||||
/* Was: objects = SCM_VELTS (bp->objs); */ \
|
||||
\
|
||||
if (objects) \
|
||||
scm_array_handle_release (&objects_handle); \
|
||||
\
|
||||
objects = scm_vector_writable_elements (bp->objs, &objects_handle, \
|
||||
&object_count, &_vincr); \
|
||||
if (SCM_I_IS_VECTOR (bp->objs)) { \
|
||||
objects = SCM_I_VECTOR_WELTS (bp->objs); \
|
||||
object_count = SCM_I_VECTOR_LENGTH (bp->objs); \
|
||||
} else { \
|
||||
objects = NULL; \
|
||||
object_count = 0; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue