Refactor how signatures/trampolines are stored in Store

This commit refactors where trampolines and signature information is
stored within a `Store`, namely moving them from
`wasmtime_runtime::Instance` instead to `Store` itself. The goal here is
to remove an allocation inside of an `Instance` and make them a bit
cheaper to create. Additionally this should open up future possibilities
like not creating duplicate trampolines for signatures already in the
`Store` when using `Func::new`.
This commit is contained in:
Alex Crichton
2020-10-25 15:54:21 -07:00
parent de4af90af6
commit 3887881800
14 changed files with 159 additions and 181 deletions

View File

@@ -492,6 +492,11 @@ impl VMSharedSignatureIndex {
pub fn new(value: u32) -> Self {
Self(value)
}
/// Returns the underlying bits of the index.
pub fn bits(&self) -> u32 {
self.0
}
}
impl Default for VMSharedSignatureIndex {