Stream: git-wasmtime

Topic: wasmtime / PR #8082 Use the wasmtime-cranelift for winch ...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2024 at 23:47):

elliottt opened PR #8082 from elliottt:trevor/winch-cranelift-trampolines to bytecodealliance:main:

Instead of reimplementing the component trampolines directly in terms of Winch's MacroAssembler trait, reuse wasmtime-cranelift's Compiler implementation to do that heavy lifting.

I had to remove the type parameter from CompiledFunction and make it a boxed dyn Trait to make this work, due to the requirements of Compiler::append_code, and the visibility of ModuleTextBuilder in the crate hierarchy. I think that this refactoring could be pushed further to avoid the need to have the Compiler trait interface produce &dyn Any results for compiled functions, but haven't looked into making changes further than what was needed to get component trampolines working here.
<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2024 at 23:47):

elliottt requested alexcrichton for a review on PR #8082.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2024 at 23:47):

elliottt requested wasmtime-default-reviewers for a review on PR #8082.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2024 at 23:47):

elliottt requested wasmtime-core-reviewers for a review on PR #8082.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2024 at 23:51):

elliottt edited PR #8082:

Instead of reimplementing the component trampolines directly in terms of Winch's MacroAssembler trait, reuse wasmtime-cranelift's Compiler implementation to do that heavy lifting.

I had to remove the type parameter from CompiledFunction and make it a boxed dyn Trait to make this work, due to the requirements of Compiler::append_code, and the visibility of ModuleTextBuilder in the crate hierarchy. I think that this refactoring could be pushed further to avoid the need to have the Compiler trait interface produce &dyn Any results for compiled functions, but haven't looked into making changes further than what was needed to get component trampolines working here.

We can push this work further to remove all trampoline generation from the wasmtime-winch crate, however I didn't want to bulk out the diff in this PR with that additional change, as it's not necessary for running components with winch.
<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2024 at 23:53):

elliottt edited PR #8082:

Instead of reimplementing the component trampolines directly in terms of Winch's MacroAssembler trait, reuse wasmtime-cranelift's Compiler implementation to do that heavy lifting.

I had to remove the type parameter from CompiledFunction and make it a boxed dyn Trait to make this work, due to the requirements of Compiler::append_code, and the visibility of ModuleTextBuilder in the crate hierarchy. I think that this refactoring could be pushed further to avoid the need to have the Compiler trait interface produce &dyn Any results for compiled functions, but haven't looked into making changes further than what was needed to get component trampolines working here.

We can push this work further to remove all trampoline generation from the wasmtime-winch crate, however I didn't want to bulk out the diff in this PR with that additional change, as it's not necessary for running components with winch.

TODO

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2024 at 23:55):

elliottt edited PR #8082:

Instead of reimplementing the component trampolines directly in terms of Winch's MacroAssembler trait, reuse wasmtime-cranelift's Compiler implementation to do that heavy lifting.

I had to remove the type parameter from CompiledFunction and make it a boxed dyn Trait to make this work, due to the requirements of Compiler::append_code, and the visibility of ModuleTextBuilder in the crate hierarchy. I think that this refactoring could be pushed further to avoid the need to have the Compiler trait interface produce &dyn Any results for compiled functions, but haven't looked into making changes further than what was needed to get component trampolines working here.

We can push this work further to remove all trampoline generation from the wasmtime-winch crate, however I didn't want to bulk out the diff in this PR with that additional change, as it's not necessary for running components with winch.

TODO

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2024 at 23:56):

elliottt edited PR #8082:

Instead of reimplementing the component trampolines directly in terms of Winch's MacroAssembler trait, reuse wasmtime-cranelift's Compiler implementation to do that heavy lifting.

I had to remove the type parameter from CompiledFunction and make it a boxed dyn Trait to make this work, due to the requirements of Compiler::append_code, and the visibility of ModuleTextBuilder in the crate hierarchy. I think that this refactoring could be pushed further to avoid the need to have the Compiler trait interface produce &dyn Any results for compiled functions, but haven't looked into making changes further than what was needed to get component trampolines working here.

We can push this work further to remove all trampoline generation from the wasmtime-winch crate, however I didn't want to bulk out the diff in this PR with that additional change, as it's not necessary for running components with winch.

TODO

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Mar 12 2024 at 01:03):

github-actions[bot] commented on PR #8082:

Subscribe to Label Action

cc @saulecabrera

<details>
This issue or pull request has been labeled: "winch"

Thus the following users have been cc'd because of the following labels:

To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.

Learn more.
</details>

view this post on Zulip Wasmtime GitHub notifications bot (Mar 12 2024 at 19:38):

elliottt updated PR #8082.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 12 2024 at 19:41):

elliottt edited PR #8082:

Instead of reimplementing the component trampolines directly in terms of Winch's MacroAssembler trait, reuse wasmtime-cranelift's Compiler implementation to do that heavy lifting.

I had to remove the type parameter from CompiledFunction and make it a boxed dyn Trait to make this work, due to the requirements of Compiler::append_code, and the visibility of ModuleTextBuilder in the crate hierarchy. I think that this refactoring could be pushed further to avoid the need to have the Compiler trait interface produce &dyn Any results for compiled functions, but haven't looked into making changes further than what was needed to get component trampolines working here.

We can push this work further to remove all trampoline generation from the wasmtime-winch crate, however I didn't want to bulk out the diff in this PR with that additional change, as it's not necessary for running components with winch.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Mar 12 2024 at 19:42):

elliottt updated PR #8082.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 12 2024 at 19:42):

elliottt has marked PR #8082 as ready for review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 12 2024 at 19:44):

github-actions[bot] commented on PR #8082:

Subscribe to Label Action

cc @peterhuene

<details>
This issue or pull request has been labeled: "wasmtime:api", "wasmtime:config"

Thus the following users have been cc'd because of the following labels:

To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.

Learn more.
</details>

view this post on Zulip Wasmtime GitHub notifications bot (Mar 12 2024 at 19:44):

github-actions[bot] commented on PR #8082:

Label Messager: wasmtime:config

It looks like you are changing Wasmtime's configuration options. Make sure to
complete this check list:

[fuzzing-config]: https://github.com/bytecodealliance/wasmtime/blob/ca0e8d0a1d8cefc0496dba2f77a670571d8fdcab/crates/fuzzing/src/generators.rs#L182-L194
[fuzzing-docs]: https://docs.wasmtime.dev/contributing-fuzzing.html


<details>

To modify this label's message, edit the <code>.github/label-messager/wasmtime-config.md</code> file.

To add new label messages or remove existing label messages, edit the
<code>.github/label-messager.json</code> configuration file.

Learn more.

</details>

view this post on Zulip Wasmtime GitHub notifications bot (Mar 12 2024 at 19:51):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 12 2024 at 19:51):

alexcrichton has enabled auto merge for PR #8082.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 12 2024 at 21:20):

elliottt updated PR #8082.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 12 2024 at 22:05):

elliottt updated PR #8082.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 12 2024 at 23:17):

elliottt merged PR #8082.


Last updated: Dec 23 2024 at 12:05 UTC