Stream: git-wasmtime

Topic: wasmtime / PR #1834 Allow ModuleTranslationState to be co...


view this post on Zulip Wasmtime GitHub notifications bot (Jun 06 2020 at 00:35):

cfallin opened PR #1834 from module-translation-state-multivalue to master:

This is needed to allow SpiderMonkey to provide function signature types
to the wasm translator when it uses Cranelift as a backend without
using the wasm translator to parse the entire module. There is perhaps a
better long-term design here where we allow an embedding that already
parses the Wasm module (such as SpiderMonkey) to provide information in
a more principled way, this suffices for now.

Patch is inspired by @bnjbvr's patch in
https://bugzilla.mozilla.org/show_bug.cgi?id=1641504, but does not
expose wasmparser types directly, instead using Cranelift types across
the API boundary.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Jun 06 2020 at 00:35):

cfallin requested bnjbvr for a review on PR #1834.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 08 2020 at 15:32):

bnjbvr created PR Review Comment:

Could the type of the two parameters be &[Type], instead? it would be slightly simpler for users, and wouldn't require the extra call to into_boxed_slice on the Spidermonkey side.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 08 2020 at 15:32):

bnjbvr submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 08 2020 at 15:32):

bnjbvr created PR Review Comment:

(am i understanding correctly that there's Something that infers that we want a Result<Vec<T>> from a Vec<Result<T>>? I can imagine how this works, but I didn't know it was available, this is brilliant!)

view this post on Zulip Wasmtime GitHub notifications bot (Jun 08 2020 at 15:32):

bnjbvr submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 08 2020 at 19:19):

cfallin updated PR #1834 from module-translation-state-multivalue to master:

This is needed to allow SpiderMonkey to provide function signature types
to the wasm translator when it uses Cranelift as a backend without
using the wasm translator to parse the entire module. There is perhaps a
better long-term design here where we allow an embedding that already
parses the Wasm module (such as SpiderMonkey) to provide information in
a more principled way, this suffices for now.

Patch is inspired by @bnjbvr's patch in
https://bugzilla.mozilla.org/show_bug.cgi?id=1641504, but does not
expose wasmparser types directly, instead using Cranelift types across
the API boundary.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Jun 08 2020 at 19:19):

cfallin submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 08 2020 at 19:19):

cfallin created PR Review Comment:

Done!

view this post on Zulip Wasmtime GitHub notifications bot (Jun 08 2020 at 19:20):

cfallin submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 08 2020 at 19:20):

cfallin created PR Review Comment:

Indeed, there is apparently a FromIterator implementation for Result that makes this work!

view this post on Zulip Wasmtime GitHub notifications bot (Jun 08 2020 at 20:00):

cfallin merged PR #1834.


Last updated: Nov 22 2024 at 17:03 UTC