-
Notifications
You must be signed in to change notification settings - Fork 10
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
Tail-call interpreter dispatch #120
Merged
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
- Working fibonacci - get rid of self.continuation (and other continuations)
…ptr, label_ptr, frame_ptr
- Working testsuite!
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.
Description
See #114 and ziglang/zig#8220
In comparison to #118, this PR:
a) works!
b) retains the original 3-stack system
#118 attempts to use more parameters in the tail-call functions in an effort to get the compiler to fix them in registers. To try and minimise the parameters I was trying to unify the 3 stacks into a single stack which would mix control flow and operands (kind of like the native stack). Whilst it is working to an extent (fib works) the testsuite isn't passing and the things that don't work I need to spend more time figuring out how to implement in the single-stack worldview.
#118 also tends to degrade the code quality, mostly through trying to get the stack pointer into the function parameters. Admittedly #118 is a bit faster than this PR, but I do prefer the code of this PR.
To reiterate:
try
and resort to passing in an optional pointer to a custom error unionWasmError
. Hopefully that issue gets fixed and we can go back totry
, though there may be some reason why that won't be possible. On balance I can live with the optional pointer.Performance
This PR
perf -d -d -d stat ./fib
:Previous master
PR for #118:
My understanding of the above perfs:
Future work
call
orcall_indirect