Experimental JIT compiler - #3292
Closed
z0w0 wants to merge 10 commits into
Closed
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is my 3rd attempt to get this working over around 4 months. It's working pretty well compared to last attempts.
I've found that it runs perfectly (slow parsing/compiling times, fast executing times) with most tests running fine. Most benchmarks actually run faster than statically compiled executables! Of course, it's not perfect yet and there are some issues:
llvm::sys::DynamicLibrary::LoadLibraryPermanentlyis segfaulting when I try and load crates. The code to do this (pretty simple) is commented out and ready to be fixed (I imagine the fix is something simple)stdandcoreare the only crates available because of above - they're only available because the JIT compiler usesdlsymto resolve symbols from the main program and any loaded crates - hence it loads thestdandcorecrates used byrustc. This is not a good idea, as users may want to use specific versions of the core libraries, so it has to be fixed with above--testresults interminate called after throwing an instance of 'rust_task*'- I do not know enough to understand what's causing thatThese issues can easily be fixed in patches (I'll investigate the first two issues) but I'm not sure about the 3rd one. #rust were pretty keen to see this pulled upstream and I think it's ready for that.
Also important to mention is I based the memory manager source code on LLVM's
llitool (most of the original comments remain) because it worked well with what was needed and it had fixed issues that I knew were going to be hit (also it was the only good example of JIT memory managers that I could find - MCJIT managers require them in order to run). Not sure what sort of things need to be done there in terms of licensing / credits / etc.