diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-10-29 22:12:27 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-10-30 06:05:52 -0700 |
commit | 264acd9ec91a7e75dc43ec57d863777b7812cc52 (patch) | |
tree | ea6548648f189160692fb4b0f9df658481ff6096 /402time.mu | |
parent | 8fe51755bf9a0ac7270599cf096e7fc2ffd50c83 (diff) | |
download | mu-264acd9ec91a7e75dc43ec57d863777b7812cc52.tar.gz |
7144 - tmp: redo checks for function outputs
This isn't done, but an intermediate snapshot seems worth capturing. Back in March (commit 6082), I made a plan to check writes to function outputs using liveness analysis. I've been shying away from actually acting on this plan ever since. In recent weeks I've had this gap bite me three times. Returning to the problem now, I think I don't actually need to compute variable liveness. The compiler can, I think, do the same thing for output registers whether their variables are alive or dead. The new rule is this: Once a register gets a function output written to it, no local is popped into it. Instead of popping outer locals to the register, we simply increment the stack and keep going. Since the function output will continue to live on the vars stack past this point (see clean-up-block), any attempts to read shadowed variables will throw an error as usual. This rule is also now easy to explain to people, I think. "You wrote the function output. Now the register can't be used for anything else." It's really cool that this works (if it does). Another fruit from "Mu's lovely property."
Diffstat (limited to '402time.mu')
0 files changed, 0 insertions, 0 deletions