mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-22 05:01:33 +00:00
Make module info store FuncSig, not Arc<FuncSig>
This commit is contained in:
@ -62,10 +62,7 @@ impl<'module, 'isa, 'data> ModuleEnvironment<'data> for ModuleEnv<'module, 'isa>
|
||||
/// Declares a function signature to the environment.
|
||||
fn declare_signature(&mut self, sig: &ir::Signature) {
|
||||
self.signatures.push(sig.clone());
|
||||
self.module
|
||||
.info
|
||||
.signatures
|
||||
.push(Arc::new(Converter(sig).into()));
|
||||
self.module.info.signatures.push(Converter(sig).into());
|
||||
}
|
||||
|
||||
/// Return the signature with the given index.
|
||||
|
@ -201,7 +201,7 @@ impl FuncResolverBuilder {
|
||||
|
||||
pub fn finalize(
|
||||
mut self,
|
||||
signatures: &SliceMap<SigIndex, Arc<FuncSig>>,
|
||||
signatures: &SliceMap<SigIndex, FuncSig>,
|
||||
) -> CompileResult<FuncResolver> {
|
||||
for (index, relocs) in self.external_relocs.iter() {
|
||||
for ref reloc in relocs.iter() {
|
||||
@ -263,8 +263,8 @@ impl FuncResolverBuilder {
|
||||
},
|
||||
},
|
||||
RelocationType::Signature(sig_index) => {
|
||||
let sig_index =
|
||||
SigRegistry.lookup_sig_index(Arc::clone(&signatures[sig_index]));
|
||||
let signature = SigRegistry.lookup_signature_ref(&signatures[sig_index]);
|
||||
let sig_index = SigRegistry.lookup_sig_index(signature);
|
||||
sig_index.index() as _
|
||||
}
|
||||
};
|
||||
|
@ -137,11 +137,11 @@ impl ProtectedCaller for Caller {
|
||||
}
|
||||
}
|
||||
|
||||
fn get_func_from_index(
|
||||
module: &ModuleInner,
|
||||
fn get_func_from_index<'a>(
|
||||
module: &'a ModuleInner,
|
||||
import_backing: &ImportBacking,
|
||||
func_index: FuncIndex,
|
||||
) -> (*const vm::Func, Context, Arc<FuncSig>, SigIndex) {
|
||||
) -> (*const vm::Func, Context, &'a FuncSig, SigIndex) {
|
||||
let sig_index = *module
|
||||
.info
|
||||
.func_assoc
|
||||
@ -167,7 +167,7 @@ fn get_func_from_index(
|
||||
}
|
||||
};
|
||||
|
||||
let signature = Arc::clone(&module.info.signatures[sig_index]);
|
||||
let signature = &module.info.signatures[sig_index];
|
||||
|
||||
(func_ptr, ctx, signature, sig_index)
|
||||
}
|
||||
|
Reference in New Issue
Block a user