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

Use C++ templates to create specialization of Interpreter loop #62

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

smarr
Copy link
Member

@smarr smarr commented Feb 24, 2025

Previously, I used macros, because I couldn’t figure out how to get C++ templates to work so that we have the interpreter loop specialized for bytecode tracing and without.

Turns out the template parameter shouldn’t be a function parameter, which I for some reason thought would be needed before.

And with this, we can rely on C++ templates to avoid any run-time cost for supporting tracing.
As before, there are two compilations of the bytecode loop one with and one without tracing.

Previously, I used macros, because I couldn’t figure out how to get this to work with templates. Turns out the template parameter shouldn’t be a function parameter, which I for some reason thought would be needed before.

Signed-off-by: Stefan Marr <[email protected]>
@smarr smarr merged commit 3c982cb into SOM-st:master Feb 24, 2025
19 checks passed
@smarr smarr deleted the use-templates-for-interp-loop branch February 24, 2025 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant