-
Notifications
You must be signed in to change notification settings - Fork 321
Integrate Wasmi IR 3.0 into wasmi
#1655
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
Draft
Robbepop
wants to merge
367
commits into
main
Choose a base branch
from
rf-integrate-wasmi-ir-3.0
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+8,024
−13,179
Conversation
This file contains hidden or 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
Merged
41aad7c to
bb8b966
Compare
12a19d4 to
64f420e
Compare
48242ca to
4d2d316
Compare
7bfb899 to
c32c7c7
Compare
7b54b34 to
7619847
Compare
This state either signals that there is an external reason for the break or that there was a trap with a specific trap code.
This makes use of TrapCode encoding within the Break type which allows for better modularity within execution handler logic.
This is going to replace the IntoTrapResult utility trait.
Benchmarks show 2-3% performance increase on the tiny_keccak case.
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.
Wasmi IR 3.0 definitions: #1650
Potential optimizations:
ipin execution handlers as in op-decode. (🟢 -11%fibonacci/iter)CallStackintoframes. (easy)extra-checksfor technically-infallible conditional panics. (easy)Slottype to avoid mul-by-8 during execution. (easy)TrapCode::OutOfSystemMemoryinStackoperations where necessary.trampolinebased operators dispatch to avoid state copy. (medium)extern "sysv64"ABI for execution handlers on Windows. (medium)Instancerelated instead ofModulereleated. (follow-up PR)Development Notes
panic-free for tail calls to be properly generated.::core::panic::catch_unwindand convert potential panics into flags signalling bad state to the interpreter.ToDo
Fix known bugs:
copy_spanvalues in translator.reverse_complementresult.regex_reduxresult.Implement Functionality
call_importedcall_indirectreturn_call_importedreturn_call_indirectbr_tableoperatorsreturn_call*operatorsmemoryoperatorstableoperatorssimdoperatorsrelaxed-simdoperatorswide-arithmeticoperatorsPreliminary Benchmarks
Preliminary benchmarks of this WIP state pre-optimization shows interesting results:
execute/fibonacci/itermaincompacttrampolinescompact+trampolinesexecute/fibonacci/recmaincompacttrampolinescompact+trampolinesexecute/fibonacci/tailmaincompacttrampolinescompact+trampolinesexecute/tiny_keccakmaincompacttrampolinescompact+trampolinesBenchmarks Conclusion
tail-call-based direct-dispatch outperformsmainsignificantly.tail-call-based indirect-dispatch is somewhat on par withmain.main.