[Vm-dev] Abstract & concrete registers
eliot.miranda at gmail.com
Sun Dec 6 18:17:10 UTC 2015
when I started the Cogit I made the decision to have the notion of abstract registers (ReceiverResultReg, ClassReg, Arg0Reg et al) separate from concrete registers (EAX et al on x86, etc). I used negative indices for abstract and non-negative indices for concrete. But this means the back end has to map from one to the other and with much better register allocation being a priority for Clément and I to deliver in April next year I'm thinking that this was a mistake. After all, the important things are the names, and the relevant back end can simply initialize the abstract registers with the concrete induces and then the napping could go away.
The only issue I see is that in some circumstances nil is passed to a method expecting an optional abstract register, but nil maps to 0 in C and so would be confused for e.g. EAX, which has the value 0. For this I guess we could use -1, named e.g. NoRegister.
Before doing this I thought I'd ask y'all to think about the implications and see if we think it makes sense collectively. So over the next few weeks, in working with the code, consider the issue, and I'll prompt you to state your conclusions then.
More information about the Vm-dev