-
Notifications
You must be signed in to change notification settings - Fork 98
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
Implement the GC in Rust #1750
Merged
Merged
Implement the GC in Rust #1750
Commits on Sep 3, 2020
-
This implements the current garbage collector in Rust. No changes were made to the GC design -- it's just ports the one implemented in code generator to Rust. The goals are: - Evaluate Rust for Motoko's RTS implementation - Make the collector easier to read, understand, modify, and extend. Currently passes the tests locally. We can't run this branch on CI yet as it needs to download rustc nightly and xargo and the domains are not allowed on the CI. I think in the final version we'll have to build rustc outselves instead of downloading. (Nightly rustc is needed as "core" distributed with rustc is not built with PIC relocation model on wam32, so we can't use it to generate a shared wasm32 library) Main changes: - New Rust crate "motoko-rts" introduced, which currently implements the garbage collector. It also has some utilities for printing the heap or individual objects, to be used when debugging. - Nix files updated to download rustc and xargo. These are used to build Rust's "core" library with PIC relocation model for wasm32. - We no longer build memset and memcpy of musl as those are provided by Rust's "core" now. The main algorithm is in `gc.rs`. Rest of the Rust files are helpers, mainly for debugging. Other changes: - I had to update lots of ic-ref-run outputs. See #1854 for the details. Remaining work and issues: - Figure out how to use rustc nightly (with PIC wasm32 libraries) in CI. Note to reviewers: - The main algorithm is in `gc.rs`, everything else is helpers. Start reading from `gc.rs`.
Configuration menu - View commit details
-
Copy full SHA for f245b75 - Browse repository at this point
Copy the full SHA f245b75View commit details -
Apply suggestions from code review
Co-authored-by: Joachim Breitner <mail@joachim-breitner.de>
Configuration menu - View commit details
-
Copy full SHA for ce9828a - Browse repository at this point
Copy the full SHA ce9828aView commit details -
Configuration menu - View commit details
-
Copy full SHA for eb33aac - Browse repository at this point
Copy the full SHA eb33aacView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5adcd4e - Browse repository at this point
Copy the full SHA 5adcd4eView commit details -
Configuration menu - View commit details
-
Copy full SHA for c99c3fe - Browse repository at this point
Copy the full SHA c99c3feView commit details -
Configuration menu - View commit details
-
Copy full SHA for b413d98 - Browse repository at this point
Copy the full SHA b413d98View commit details -
Configuration menu - View commit details
-
Copy full SHA for 755a096 - Browse repository at this point
Copy the full SHA 755a096View commit details -
Configuration menu - View commit details
-
Copy full SHA for ee53aa0 - Browse repository at this point
Copy the full SHA ee53aa0View commit details -
Configuration menu - View commit details
-
Copy full SHA for e59f35b - Browse repository at this point
Copy the full SHA e59f35bView commit details -
Also tweaks the build system a little bit to avoid linking multiple versions of compiler_builtins.
Configuration menu - View commit details
-
Copy full SHA for 3da969c - Browse repository at this point
Copy the full SHA 3da969cView commit details -
Rust doesn't allow implementing methods on pointer types so we have to use associated functions.
Configuration menu - View commit details
-
Copy full SHA for 2b2a8f7 - Browse repository at this point
Copy the full SHA 2b2a8f7View commit details -
Implement some helper methods for Word and Bytes types
- Add and AddAssign to support + and += - Conversion methods instead of functions and From
Configuration menu - View commit details
-
Copy full SHA for 3d3a9be - Browse repository at this point
Copy the full SHA 3d3a9beView commit details -
Configuration menu - View commit details
-
Copy full SHA for bd13ac9 - Browse repository at this point
Copy the full SHA bd13ac9View commit details -
Remove magic values in object_size, refactor Bytes/Words a little bit…
… more, fix BigInt layout - I figured out how to implement methods on pointer types, make payload_addr a method on pointers - Fix BigInt layout (sign field was missing) - Remove magic values in object_size
Configuration menu - View commit details
-
Copy full SHA for 59890cc - Browse repository at this point
Copy the full SHA 59890ccView commit details -
Configuration menu - View commit details
-
Copy full SHA for 53f24e5 - Browse repository at this point
Copy the full SHA 53f24e5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 567475e - Browse repository at this point
Copy the full SHA 567475eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1f8b54a - Browse repository at this point
Copy the full SHA 1f8b54aView commit details -
Configuration menu - View commit details
-
Copy full SHA for a8f1c90 - Browse repository at this point
Copy the full SHA a8f1c90View commit details -
Configuration menu - View commit details
-
Copy full SHA for 52060df - Browse repository at this point
Copy the full SHA 52060dfView commit details -
Rename indirection -> forwarding pointer
(The word "forwarding pointer" is used widely in the literature for these things)
Configuration menu - View commit details
-
Copy full SHA for 8d02c33 - Browse repository at this point
Copy the full SHA 8d02c33View commit details -
Configuration menu - View commit details
-
Copy full SHA for 01758d0 - Browse repository at this point
Copy the full SHA 01758d0View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.