Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor and simplify component trampolines
In poking at #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. The `Trampoline` 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.
- Loading branch information