Code review feedback.
* Make `FunctionInfo` public and `CompiledModule::func_info` return it. * Make the `StackMapLookup` trait unsafe. * Add comments for the purpose of `EngineHostFuncs`. * Rework ownership model of shared signatures: `SignatureCollection` in conjunction with `SignatureRegistry` is now used so that the `Engine`, `Store`, and `Module` don't need to worry about unregistering shared signatures. * Implement `Func::param_arity` and `Func::result_arity` in terms of `Func::ty`. * Make looking up a trampoline with the module registry more efficient by doing a binary search on the function's starting PC value for the owning module and then looking up the trampoline with only that module. * Remove reference to the shared signatures from `GlobalRegisteredModule`.
This commit is contained in:
@@ -270,7 +270,11 @@ pub fn create_function(
|
||||
// If there is no store, use the default signature index which is
|
||||
// guaranteed to trap if there is ever an indirect call on the function (should not happen)
|
||||
let shared_signature_id = store
|
||||
.map(|s| s.register_signature(ft.as_wasm_func_type(), trampoline))
|
||||
.map(|s| {
|
||||
s.signatures()
|
||||
.borrow_mut()
|
||||
.register(ft.as_wasm_func_type(), trampoline)
|
||||
})
|
||||
.unwrap_or(VMSharedSignatureIndex::default());
|
||||
|
||||
unsafe {
|
||||
|
||||
Reference in New Issue
Block a user