Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any changes in code generation since 1.4? #247

Open
ggutierrez opened this issue Nov 6, 2014 · 1 comment
Open

Any changes in code generation since 1.4? #247

ggutierrez opened this issue Nov 6, 2014 · 1 comment
Labels

Comments

@ggutierrez
Copy link
Member

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
Copy link
Member

sjrd commented Nov 6, 2014

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 on return and tailCall instructions.
  • putConstant/setConstant disappeared, since arbitrary constants can be spliced in K 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants