diff options
author | Andy Wingo <wingo@pobox.com> | 2008-09-09 07:15:01 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2008-09-09 07:15:01 +0200 |
commit | 8e3670748f86ae78cc59a628d9262ad165c1fae4 (patch) | |
tree | 0d8664dc797d21c0ee8f0dd945c5044efe576bdb /libguile/vm-i-loader.c | |
parent | 7618201efd35d653b98d3c1036d65e36b2c6db53 (diff) | |
download | guile-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/vm-i-loader.c')
-rw-r--r-- | libguile/vm-i-loader.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/libguile/vm-i-loader.c b/libguile/vm-i-loader.c index 2816d3309..34d1cec92 100644 --- a/libguile/vm-i-loader.c +++ b/libguile/vm-i-loader.c @@ -172,16 +172,6 @@ VM_DEFINE_INSTRUCTION (link_now, "link-now", 0, 1, 1) NEXT; } -VM_DEFINE_INSTRUCTION (link_later, "link-later", 0, 2, 1) -{ - SCM modname, sym; - POP (sym); - POP (modname); - SYNC_REGISTER (); - PUSH (scm_cons (modname, sym)); - NEXT; -} - VM_DEFINE_LOADER (define, "define") { SCM sym; |