summaryrefslogtreecommitdiffstats
path: root/tests/012/stslot.expected
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-04-07 20:36:37 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-04-07 20:36:37 -0700
commit82e668def2120b1f00fadd9b5d89c45a3fb54467 (patch)
tree9b82344c6d34d8c641368475749f47a683a30f40 /tests/012/stslot.expected
parent7cf66ee31d57cb31f784c4e5983828ae01dfc4d2 (diff)
downloadtxr-82e668def2120b1f00fadd9b5d89c45a3fb54467.tar.gz
txr-82e668def2120b1f00fadd9b5d89c45a3fb54467.tar.bz2
txr-82e668def2120b1f00fadd9b5d89c45a3fb54467.zip
compiler: fix overestimated register count.
The compiler internally allocates registers that are never inserted into code (but correctly recycled). Thus the treg bump counter overestimates the actual number of registers that a VM requires; but that's how we use it! That causes wasted stack space. What we can do to get a tightly clamped register count is simply to let the assembler report the highest-numbered treg operand that it finds in the code. (In the future we will need something better to optimize the register allocation. Why: because closures have their own VM instance with its own registers. If an overall VM uses registers t00 through t09, but a certain closure uses only t02 through t06, that closure's frame only needs to allocate seven registers.) * share/txr/stdlib/asm.tl (assembler): New slot, max-treg. (assembler parse-args): Whenever a register operand is parsed, if it is a t register, update max-treg. * share/txr/stdlib/compiler.tl (usr:compile-toplevel): When creating the vm-desc, determine the nreg parameter from the assembler's max-treg value, rather than from the compiler's treg allocation bump counter.
Diffstat (limited to 'tests/012/stslot.expected')
0 files changed, 0 insertions, 0 deletions