Skip to content

Implement various code generation traits for VM Backend#1106

Merged
feds01 merged 16 commits intomainfrom
vm-main
Jan 12, 2026
Merged

Implement various code generation traits for VM Backend#1106
feds01 merged 16 commits intomainfrom
vm-main

Conversation

@feds01
Copy link
Contributor

@feds01 feds01 commented Jan 12, 2026

  • Remove backend_field_index from backend codegen
  • Remove TyMemoryRemaps
  • Adjust BlockBuilderMethods documentation
  • vm: adjust Stack API implementation
  • vm: make FunctionBuilder support out of order block building
  • vm: add BytecodeBuilder and FunctionBuilder to build process
  • vm: record current function that is being built in BytecodeBuilder
  • vm: builder: support using SP as operand for add64
  • vm: setup VMBuilder to store the builder ctx
  • codegen: simplify generating FnAbi from types
  • codegen(vm): implement types, layouts and misc translation methods
  • codegen: Avoid working with Instances directly
  • chore: lints and formatting
  • vm: Unify heap and stack view into Memory
  • bytecode: change write* operations to accept Operand instead of Register
  • vm: implement more builder methods

feds01 added 16 commits January 7, 2026 20:51
This method is un-needed as we can achieve the same result
by just reading the field offset from the `Layout`.
This hooks up the builder in preparation for where the builder methods
will be implemented in future commits.
Also, keep a record of the original type that was used to generate the
`FnAbi`. This saves us having to reverse the type and lead to
generating an type ID that mismatches the original type.
Prefer using `ReprTyId`s instead of instances. We can always
determine the instance from the type, but not vice versa.
@feds01 feds01 self-assigned this Jan 12, 2026
@feds01 feds01 added vm codegen Issues related with code generation on any backend labels Jan 12, 2026
@feds01 feds01 merged commit 58e5071 into main Jan 12, 2026
1 check passed
@feds01 feds01 deleted the vm-main branch January 12, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codegen Issues related with code generation on any backend vm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant