summaryrefslogtreecommitdiffstats
path: root/vmop.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-11-04 11:52:03 -0800
committerKaz Kylheku <kaz@kylheku.com>2018-11-04 11:52:03 -0800
commit44c8e70f810ad52b0f26f06147d5613ed1271900 (patch)
tree6ac8814ce1c8f5a7f2159e19f53f530a072b3aa1 /vmop.h
parent167ae958a8a4376703ade38a8f9c56763e3626f3 (diff)
downloadtxr-44c8e70f810ad52b0f26f06147d5613ed1271900.tar.gz
txr-44c8e70f810ad52b0f26f06147d5613ed1271900.tar.bz2
txr-44c8e70f810ad52b0f26f06147d5613ed1271900.zip
compiler: optimize dwim.
* share/txr/stdlib/asm.tl (op-getf): Rename to op-oldgetf. This opcode becomes obsolescent. (op-getf): New opcode. * share/txr/stdlib/compiler.tl (assumed-fun): New global variable. (compiler comp-fun): Use the new getf instruction which takes a function table index instead of a data table index. (compiler comp-lisp1-value): Don't use getl1 opcode any more for dynamic lisp1-style lookup. Instead, we bake the behavior at compile time perform a function lookup if the symbol is completely unbound, a variable lookup if it is bound to a variable (where we decide at compile tie whether it is lexical or dynamic) or else a function if a function binding exists at compile time. Also, if we assume that an unbound symbol is a function, put it on the assumed-fun list. (compiler comp-dwim): If the first argument is a symbol with no lexical binding, and is not bound as a variable, then treat it as a function by transforming the form into a function call form with that symbol in the car position. Put the symbol on the assumed-fun list. (compiler-emit-warnings): New function. (with-compilation-unit): Call compiler-emit-warnings when bailing out of most enclosing compilation unit. (%tlo-ver%): Bump compiled file version to 4, since we added an opcode. * vm.c (vm_execute): Follow rename of GETF to OLDGETF. Implement the new GETF. * parser.c (read_file_common): Extend version range to allow version 4 compiled files. * txr.1: Documented everything.
Diffstat (limited to 'vmop.h')
-rw-r--r--vmop.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/vmop.h b/vmop.h
index cb2f41af..bfe3011d 100644
--- a/vmop.h
+++ b/vmop.h
@@ -57,7 +57,7 @@ typedef enum vm_op {
CATCH = 28,
HANDLE = 29,
GETV = 30,
- GETF = 31,
+ OLDGETF = 31,
GETL1 = 32,
GETVB = 33,
GETFB = 34,
@@ -68,4 +68,5 @@ typedef enum vm_op {
CLOSE = 39,
GETLX = 40,
SETLX = 41,
+ GETF = 42,
} vm_op_t;