From c4d91d0128dd998a73d216fe7bb0132c41d901bc Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 26 Oct 2018 07:22:33 -0700 Subject: vm/asm: new instructions getlx and setlx. These instructions can be used for accessing cached global variable bindings through the symtab of the vm descriptor. The compiler will use these for optimizing access to global lexical variables. * share/txr/stdlib/asm.tl (op-getlx, op-setlx): New opcode classes. * vm.c (vm_stab): Take the lookup function as an argument, so this can be used for variable bindings. (vm_gcall, vm_gapply): Pass lookup_fun function to vm_stab, as well as the appropriate string for the unbound error. (vm_gettab, vm_settab): New static functions. (vm_execute): Implement GETLX and SETLX using vm_gettab and vm_settab. * vmop.h: Regenerated. --- vmop.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'vmop.h') diff --git a/vmop.h b/vmop.h index 48bfa903..cb2f41af 100644 --- a/vmop.h +++ b/vmop.h @@ -66,4 +66,6 @@ typedef enum vm_op { SETL1 = 37, BINDV = 38, CLOSE = 39, + GETLX = 40, + SETLX = 41, } vm_op_t; -- cgit v1.2.3