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

Add the new object model #45

Merged
merged 35 commits into from Aug 27, 2023
Merged

Add the new object model #45

merged 35 commits into from Aug 27, 2023

Conversation

jeaye
Copy link
Collaborator

@jeaye jeaye commented Aug 26, 2023

No description provided.

jeaye added 30 commits April 24, 2023 19:01
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.
@jeaye jeaye merged commit ba5282c into main Aug 27, 2023
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant