summaryrefslogtreecommitdiff
path: root/libguile/vm-i-system.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-01-17 16:42:53 +0100
committerAndy Wingo <wingo@pobox.com>2009-01-17 16:42:53 +0100
commit2fda0242214e1b650b8fd3eb084e1c930a8399a5 (patch)
treecb0e118575713554b98b11e4d15c91a0605f6941 /libguile/vm-i-system.c
parenta72317988fa29377928d30c7e52b5acf63b6943a (diff)
downloadguile-2fda0242214e1b650b8fd3eb084e1c930a8399a5.tar.gz
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.
Diffstat (limited to 'libguile/vm-i-system.c')
-rw-r--r--libguile/vm-i-system.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c
index 60182c75a..6e98235de 100644
--- a/libguile/vm-i-system.c
+++ b/libguile/vm-i-system.c
@@ -297,10 +297,11 @@ VM_DEFINE_INSTRUCTION (toplevel_ref, "toplevel-ref", 1, 0, 1)
SYNC_REGISTER ();
if (SCM_LIKELY (SCM_SYMBOLP (what)))
{
+ SCM mod;
if (SCM_LIKELY (scm_module_system_booted_p
- && scm_is_true (bp->module)))
+ && scm_is_true ((mod = scm_program_module (program)))))
/* might longjmp */
- what = scm_module_lookup (bp->module, what);
+ what = scm_module_lookup (mod, what);
else
what = scm_sym2var (what, SCM_BOOL_F, SCM_BOOL_F);
}
@@ -379,10 +380,11 @@ VM_DEFINE_INSTRUCTION (toplevel_set, "toplevel-set", 1, 1, 0)
SYNC_BEFORE_GC ();
if (SCM_LIKELY (SCM_SYMBOLP (what)))
{
+ SCM mod;
if (SCM_LIKELY (scm_module_system_booted_p
- && scm_is_true (bp->module)))
+ && scm_is_true ((mod = scm_program_module (program)))))
/* might longjmp */
- what = scm_module_lookup (bp->module, what);
+ what = scm_module_lookup (mod, what);
else
what = scm_sym2var (what, SCM_BOOL_F, SCM_BOOL_F);
}