forked from bytecodealliance/wasmtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore compatibility with upstream disas tests (bytecodealliance#135)
It recently became necessary to regenerate the expected output of most (all?) of the files in tests/disas. Concretely, we were generating slightly different CLIF than upstream even on modules not involving any WasmFX instructions. This PR rectifies this situation, making sure that we generate identical CLIF again. This required two changes: ## Global CLIF variable for runtime limits pointer Since bytecodealliance#99, we called the function `wasmtime_cranelift::func_environ::FuncEnvironment::declare_vmruntime_limits_ptr` unconditionally for every compiled function, meaning that every function prelude now contained a definition of the corresponding global variable. This PR changes this behavior: I restored the original logic for when to call `declare_vmruntime_limits_ptr`. Instead of using the global variable `vmruntime_limits` to access the `VMRuntimeLimits`, we now load this pointer ourselves once per `resume` instruction. Since the load instruction is marked as `readonly`, it should be coalesced into a single load, even if multiple `resume`s appear in the same function. I've benchmarked this, using a micro-benchmark with 2 resume instructions in the same function, and as expected there is no observable difference in performance. ## Order of libcall declarations In `builtin.rs`, we put the declarations of our own libcalls into the middle of the list of all libcalls in the `foreach_builtin_function` macro. This shifted the indices of some existing libcalls, which caused the CLIF to differ when using these. I've moved all the `tc_` libcalls to the end of the list, thus leaving the indices of existing libcalls unchanged. As a result, I've replaced all files in tests/disas with the versions from upstream (bytecodealliance/wasmtime@afaf1c7, the most recent upstream commit that we've merged)
- Loading branch information
1 parent
c113ff9
commit cff2e76
Showing
183 changed files
with
3,155 additions
and
3,893 deletions.
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.