From 9733bb6dad3b0c430a82b2592d5519383479cb86 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 26 Oct 2018 07:25:51 -0700 Subject: compiler: use symtab caching for global lexicals. * parser.c (read_file_common): Allow version three object files. * share/txr/stdlib/compiler.tl (compiler comp-var): If a global variable isn't special, then treat it via the getlx instruction. The symbol gets added to the symtab, and referenced by index number. (compiler comp-setq): Similarly, treat a non-special global variable using the setlx instruction. (%tlo-ver%): We bump the major version of .tlo files from 2 to 3, since old txr executables won't recognize these new instructions. However, we are backward compatible; hence read_file_common still allows version 2. --- parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'parser.c') diff --git a/parser.c b/parser.c index a6285b75..049da3a7 100644 --- a/parser.c +++ b/parser.c @@ -636,7 +636,7 @@ static val read_file_common(val stream, val error_stream, val compiled) if (compiled && first) { val major = car(form); - if (lt(major, one) || gt(major, two)) + if (lt(major, one) || gt(major, three)) uw_throwf(error_s, lit("cannot load ~s: version number mismatch"), stream, nao); -- cgit v1.2.3