From 9fdcdb3e6fa4529f6b68f93f9c7b780502243463 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 10 Apr 2018 07:03:04 -0700 Subject: 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. --- vm.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'vm.c') 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; } } -- cgit v1.2.3