summaryrefslogtreecommitdiffstats
path: root/gc.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-03-23 06:50:58 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-03-23 06:50:58 -0700
commit690038a3c75463681c2acc49689f0472b1698e89 (patch)
treeb43d0fead7be6bc3ba55b9b93c00e10cb835e013 /gc.h
parent73784f852159b14c42024bb2451c4c83067f4d6c (diff)
downloadtxr-690038a3c75463681c2acc49689f0472b1698e89.tar.gz
txr-690038a3c75463681c2acc49689f0472b1698e89.tar.bz2
txr-690038a3c75463681c2acc49689f0472b1698e89.zip
vm: change encoding of getv, setv and related.
In most compiler uses of bindv, getv and setv, the operand which names the dynamic symbol is the data table: a d0-dff register. The source or destination register of the transfer could be anything. Therefore, the existing encoding is suboptimal: the symbol is being put into the full sized operand field of the instruction, and the source or destination register into the small, ten-bit extra field in the upper half. This breaks on cases like (set x y) where x is a deeply nested lexical variable and y is a dynamic variable. Let's reverse the encoding. * share/txr/stdlib/asm.tl (op-getv, op-setv): Reverse the operands. All derived opcodes follow this since they reuse the code via inheritance. * vm.c (vm_get_binding): Fetch the symbol from the small operand field rather than the main operand field. (vm_getsym, vm_getbind, vm_setsym, vm_bindv): Pull the destination or source from the main operand of the instruction rather than the small opreand.
Diffstat (limited to 'gc.h')
0 files changed, 0 insertions, 0 deletions