alexcrichton opened PR #4327 from component-lower-then-lift
to main
:
This commit is a few features bundled into one, culminating in the
implementation of lowered-then-lifted functions for the component model.
It's probably not going to be used all that often but this is possible
within a valid component so Wasmtime needs to do something relatively
reasonable. The main things implemented in this commit are:
Component instances are now assigned a
RuntimeComponentInstanceIndex
to differentiate each one. This will be used in the future to detect
fusion (one instance lowering a function from another instance). For
now it's used to allocate separateVMComponentFlags
for each
internal component instance.The
CoreExport<FuncIndex>
of lowered functions was changed to a
CoreDef
since technically a lowered function can use another lowered
function as the callee. This ended up being not too difficult to plumb
through as everything else was already in place.A need arose to compile host-to-wasm trampolines which weren't already
present. Currently wasm in a component is always entered through a
host-to-wasm trampoline but core wasm modules are the source of all
the trampolines. In the case of a lowered-then-lifted function there
may not actually be any core wasm modules, so component objects now
contain necessary trampolines not otherwise provided by the core wasm
objects. This feature required splitting a new function into the
Compiler
trait for creating a host-to-wasm trampoline. After doing
this core wasm compilation was also updated to leverage this which
further enabled compiling trampolines in parallel as opposed to the
previous synchronous compilation.<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
alexcrichton requested fitzgen for a review on PR #4327.
fitzgen submitted PR review.
fitzgen submitted PR review.
fitzgen created PR review comment:
// flags: [VMComponentFlags; component.num_runtime_component_instances],
fitzgen created PR review comment:
better not to open code / bake in the assumption that the flags will always be one byte large, especially since we wrap them up in a
VMComponentFlags
data abstraction elsewhere:size(flags) = cmul(size_of_vm_component_flags(), ret.num_runtime_component_instances),
alexcrichton updated PR #4327 from component-lower-then-lift
to main
.
alexcrichton has enabled auto merge for PR #4327.
alexcrichton updated PR #4327 from component-lower-then-lift
to main
.
alexcrichton updated PR #4327 from component-lower-then-lift
to main
.
alexcrichton updated PR #4327 from component-lower-then-lift
to main
.
alexcrichton updated PR #4327 from component-lower-then-lift
to main
.
alexcrichton merged PR #4327.
Last updated: Dec 23 2024 at 12:05 UTC