summaryrefslogtreecommitdiff
path: root/libguile/programs.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2008-09-09 07:15:01 +0200
committerAndy Wingo <wingo@pobox.com>2008-09-09 07:15:01 +0200
commit8e3670748f86ae78cc59a628d9262ad165c1fae4 (patch)
tree0d8664dc797d21c0ee8f0dd945c5044efe576bdb /libguile/programs.h
parent7618201efd35d653b98d3c1036d65e36b2c6db53 (diff)
downloadguile-8e3670748f86ae78cc59a628d9262ad165c1fae4.tar.gz
rework late binding resolution to be simpler and more efficient
* libguile/programs.h (struct scm_program): * libguile/programs.c (scm_c_make_program): Record the current module when making a program. This replaces the per-late binding recorded module in the generated code, which should be more efficient, both in terms of garbage, and in not calling resolve-module. (program-module): New accessor. * module/system/vm/program.scm: Add program-module to exports. * libguile/vm-i-loader.c (link-later): Remove this instruction, since now the entry in the object table is just a symbol, and can be loaded with load-symbol. * libguile/vm-i-system.c (late-variable-ref, late-variable-set): Rework so as to look up in the module of the current program. The logic could be condensed quite a bit if scm_module_lookup () knew what to do with mod==#f. * module/system/vm/assemble.scm (dump-object!): Dump <vlink-later> just as load-symbol, as mentioned in the note on link-later. * module/system/il/ghil.scm: Update comment to reflect the new reality.
Diffstat (limited to 'libguile/programs.h')
-rw-r--r--libguile/programs.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libguile/programs.h b/libguile/programs.h
index 04f2d459d..0f1b57dd3 100644
--- a/libguile/programs.h
+++ b/libguile/programs.h
@@ -57,6 +57,7 @@ struct scm_program {
unsigned char nlocs; /* the number of local variables */
unsigned char nexts; /* the number of external variables */
scm_byte_t *base; /* program base address */
+ SCM module; /* resolve bindings with respect to this module */
SCM meta; /* meta data */
SCM objs; /* constant objects */
SCM external; /* external environment */
@@ -77,6 +78,7 @@ extern SCM scm_program_base (SCM program);
extern SCM scm_program_arity (SCM program);
extern SCM scm_program_meta (SCM program);
extern SCM scm_program_objects (SCM program);
+extern SCM scm_program_module (SCM program);
extern SCM scm_program_external (SCM program);
extern SCM scm_program_external_set_x (SCM program, SCM external);
extern SCM scm_program_bytecode (SCM program);