summaryrefslogtreecommitdiffstats
path: root/vm.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-04-10 07:03:04 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-04-10 07:03:04 -0700
commit9fdcdb3e6fa4529f6b68f93f9c7b780502243463 (patch)
tree593bc9ec0d6e76b0eb3b11328b909c27a7ba2def /vm.c
parent9dc1f9c5e0b47127457104f95e84d295e944d1b3 (diff)
downloadtxr-9fdcdb3e6fa4529f6b68f93f9c7b780502243463.tar.gz
txr-9fdcdb3e6fa4529f6b68f93f9c7b780502243463.tar.bz2
txr-9fdcdb3e6fa4529f6b68f93f9c7b780502243463.zip
vm: don't eagerly resolve functions.
* vm.c (vm_make_desc): Do not walk ftab to resolve the function bindings at VM instantiation time. Just let it be done late in vm_ftab when a gcall or gapply instruction is executing. We don't gain anything by doing it early; there is no error checking or anything. This early resolution causes the autoload semantics of the standard library modules to change between interpreted and compiled. When a compiled module is loaded, it immediately triggers autloads of everything that it potentially references. This suddenly broke the build under a newer GNU Make which doesn't sort the files expanded by $(wildcard ...), causing the library to be compiled in a different order.
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/vm.c b/vm.c
index ffb3bda6..04c466d9 100644
--- a/vm.c
+++ b/vm.c
@@ -136,7 +136,6 @@ val vm_make_desc(val nlevels, val nregs, val bytecode,
struct vm_ftent *ftab = if3(ftsz != 0,
coerce(struct vm_ftent *,
chk_calloc(ftsz, sizeof *ftab)), 0);
- cnum i;
val desc;
vd->nlvl = nlvl;
@@ -161,12 +160,6 @@ val vm_make_desc(val nlevels, val nregs, val bytecode,
vd->funvec = funvec;
vd->self = desc;
- for (i = 0; i < ftsz; i++) {
- struct vm_ftent *fe = &ftab[i];
- fe->fb = lookup_fun(nil, vecref(funvec, num_fast(i)));
- fe->fbloc = if3(fe->fb, cdr_l(fe->fb), nulloc);
- }
-
return desc;
}
}