Any changes in code generation since 1.4?
Opened this issue · 1 comments
ggutierrez commented
Does the code generation have been updated in version 2.0?. In concrete I would like to know if the same program will be translated to the same set of VM instructions in 1.4 and 2.0 versions.
sjrd commented
There were changes, yes. Most notably because the instruction set is slightly different.
Most of the transformations are clearly visible here:
https://github.com/mozart/mozart2/blob/master/lib/compiler/Assembler.oz#L854
For example:
- There is one more kind of registers:
K
registers, which are bound to the CodeArea, and basically contain literal constants, or in general any compile-time value spliced into the program (e.g., builtins) deallocateL
does not exist anymore. Locals are deallocated implicitly onreturn
andtailCall
instructions.putConstant
/setConstant
disappeared, since arbitrary constants can be spliced inK
registers
There were also changes to the object system. Most notably, self
is no special value anymore, it's a normal parameter.
The locking mechanisms were lifted in user space, with methods written in Oz rather than supported by VM instructions.
There might be other stuff I forgot.