summaryrefslogtreecommitdiff
path: root/libguile/vm-i-loader.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-06-05 11:47:19 +0200
committerAndy Wingo <wingo@pobox.com>2009-06-05 11:47:19 +0200
commitb7393ea123eb0f27d99ba1c38bd944f78b90eb42 (patch)
tree46f0eb6a1ff4fad21709dc020734641d319212f2 /libguile/vm-i-loader.c
parent42193dac5800fe6a63d392c8b9ebb7f9257725e2 (diff)
downloadguile-b7393ea123eb0f27d99ba1c38bd944f78b90eb42.tar.gz
refactoring for toplevel-ref, toplevel-set, link-now
* libguile/vm-i-system.c (toplevel-ref, toplevel-set) * libguile/vm-i-loader.c (link-now): * libguile/vm.c (resolve_variable): Factor out common code to a static method. The compiler can still inline it, so it shouldn't have a significant performance effect. * libguile/vm-engine.c (vm_error_no_such_module): Remove now-unused label.
Diffstat (limited to 'libguile/vm-i-loader.c')
-rw-r--r--libguile/vm-i-loader.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/libguile/vm-i-loader.c b/libguile/vm-i-loader.c
index 515001d61..b231d392f 100644
--- a/libguile/vm-i-loader.c
+++ b/libguile/vm-i-loader.c
@@ -124,29 +124,7 @@ VM_DEFINE_INSTRUCTION (66, link_now, "link-now", 0, 1, 1)
SCM what;
POP (what);
SYNC_REGISTER ();
- if (SCM_LIKELY (SCM_SYMBOLP (what)))
- {
- PUSH (scm_lookup (what)); /* might longjmp */
- }
- else
- {
- SCM mod;
- /* compilation of @ or @@
- `what' is a three-element list: (MODNAME SYM INTERFACE?)
- INTERFACE? is #t if we compiled @ or #f if we compiled @@
- */
- mod = scm_resolve_module (SCM_CAR (what));
- if (scm_is_true (SCM_CADDR (what)))
- mod = scm_module_public_interface (mod);
- if (SCM_FALSEP (mod))
- {
- finish_args = scm_list_1 (SCM_CAR (what));
- goto vm_error_no_such_module;
- }
- /* might longjmp */
- PUSH (scm_module_lookup (mod, SCM_CADR (what)));
- }
-
+ PUSH (resolve_variable (what, scm_current_module ()));
NEXT;
}