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
Add the new object model #45
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Asserting the count is the same as ensuring it doesn't get optimized away, but it allows for more optimizing away. As long as the count is right, the rest doesn't matter.
No need to track all behaviors. Just the concrete built-in types.
The ray tracer is running again, so the bulk of the runtime is working. There are likely new bugs introduced in functions I don't have tested, especially in clojure.core. Speaking of tests, those have yet to be ported, so they're disabled in CMake. Initial perf testing shows a 20% gain in the ray tracer benchmark. No profiling has been done yet, with the new object model integrated.
Building with C++20 causes all sorts of errors, due to -Werror and additional warnings.
This was a real pain to find. Not sure why the compiler didn't pick it up. :(
The tracking is minimal, so far, and is not applied very well to codegen. Right now, anything that can be unboxed is, but I'm not tracking when it also needs boxing, and I'm compensating with a lot of extra `make_box` calls, so this ends up being slower than before this change. However, it's a stepping stone. Next up is tracking boxing needs in each sem analysis function, as well as tracking usages of locals in those functions and whether or not those usages require boxes. This will give a more complete picture for codegen, which should allow us to eliminate the extra `make_box` calls.
Some of this info is being used during codegen, but we're still generating far too many `make_box` calls for objects already boxed.
This also adds a test suite for box-related semantic analysis, since I kept fixing on thing and breaking another. In order to be able to sanely check the AST-related data, I've added a new system to convert compiler data (like AST nodes) to runtime data. The tests can then just use runtime functions and normal Clojure data operations. In the future, these could be written in jank, rather than C++. I've also fixed the codegen output in main, by using the new `analyze_string` function on the RT context, combined with the expression wrapping in `evaluate`. It now works exactly as it should, since it evaluates as it goes. This is a bigger win than it may seems, since it's a step toward AOT compilation.
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.
No description provided.