Stream: git-wasmtime

Topic: wasmtime / PR #4347 Implement `canon lower` of a `canon l...


view this post on Zulip Wasmtime GitHub notifications bot (Jun 28 2022 at 19:11):

alexcrichton opened PR #4347 from component-lift-then-lower to main:

This commit implements the "degenerate" logic for implementing a
function within a component that is lifted and then immediately lowered
again. In this situation the lowered function will immediately generate
a trap and doesn't need to implement anything else.

The implementation in this commit is somewhat heavyweight but I think is
probably justified moreso in future additions to the component model
rather than what exactly is here right now. It's not expected that this
"always trap" functionality will really be used all that often since it
would generally mean a buggy component, but the functionality plumbed
through here is hopefully going to be useful for implementing
component-to-component adapter trampolines.

Specifically this commit implements a strategy where the canon.lower'd
function is generated by Cranelift and simply has a single trap
instruction when called, doing nothing else. The main complexity comes
from juggling around all the data associated with these functions,
primarily plumbing through the traps into the ModuleRegistry to
ensure that the global is_wasm_trap_pc function returns true and at
runtime when we lookup information about the trap it's all readily
available (e.g. translating the trapping pc to a TrapCode).

<!--

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 28 2022 at 19:11):

alexcrichton requested fitzgen for a review on PR #4347.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 28 2022 at 19:28):

alexcrichton updated PR #4347 from component-lift-then-lower to main.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 28 2022 at 20:47):

alexcrichton updated PR #4347 from component-lift-then-lower to main.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 28 2022 at 22:15):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 28 2022 at 22:15):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 28 2022 at 22:15):

fitzgen created PR review comment:

I guess this is a pretty rare edge case, most components will have zero, not somthing we need to worry about optimizing.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 28 2022 at 22:15):

fitzgen created PR review comment:

Can we compile a single always-trap function per signature?

view this post on Zulip Wasmtime GitHub notifications bot (Jun 29 2022 at 15:12):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 29 2022 at 15:12):

alexcrichton created PR review comment:

Nah yeah that makes sense and is easy enough to do. I've added deduplication at the "inliner" layer so byt the time it reaches the compilation in cranelift everything is already deduplicated.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 29 2022 at 15:48):

alexcrichton updated PR #4347 from component-lift-then-lower to main.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 29 2022 at 15:48):

alexcrichton has enabled auto merge for PR #4347.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 29 2022 at 16:35):

alexcrichton merged PR #4347.


Last updated: Dec 23 2024 at 12:05 UTC