alexcrichton opened PR #6751 from alexcrichton:component-trampolines
to bytecodealliance:main
:
Note that this is based on https://github.com/bytecodealliance/wasmtime/pull/6691
In poking at https://github.com/bytecodealliance/wasmtime/issues/6696 I felt that the amount of boilerplate for defining
new kinds of trampolines in the component model was getting a bit
excessive. There was already 6 different types and I was adding two more
and I had to touch just a few too many places to get this done. In the
end I decided to refactor how trampolines are handled in the component
model to make it much easier to add new kinds of trampolines.To that end the type-specific counts/lists/etc are all gone now in favor
of a single concept of a trampoline. This means components now track
trampolines in-bulk rather than individually by type. For example
compiling trampolines is now a loop over "compile this list of
trampolines" where previously it was N loops for the N types of
trampolines. TheTrampoline
definition is where the enum and dispatch
happens where that contains all possible trampolines that a component
could require.This ended up being a large refactor to the Cranelift component
integration, but there is not intended to be any functional change from
this refactoring. Additionally all trampolines are now removed from the
global initializers list since there's nothing preventing them from
being initialized earlier on during the instantiation process.Overall this should drastically reduce the number of locations that need
to have trampoline-specific knowledge to translation, the dataflow
graph, and compilation. Nearly everything else can operate over
everything in bulk and forward between these systems.
alexcrichton updated PR #6751.
alexcrichton requested fitzgen for a review on PR #6751.
alexcrichton has marked PR #6751 as ready for review.
alexcrichton requested wasmtime-core-reviewers for a review on PR #6751.
fitzgen submitted PR review:
Nice!
pchickey submitted PR review.
alexcrichton merged PR #6751.
Last updated: Dec 23 2024 at 12:05 UTC