wasmtime: Implement global.{get,set} for externref globals (#1969)
* wasmtime: Implement `global.{get,set}` for externref globals
We use libcalls to implement these -- unlike `table.{get,set}`, for which we
create inline JIT fast paths -- because no known toolchain actually uses
externref globals.
Part of #929
* wasmtime: Enable `{extern,func}ref` globals in the API
This commit is contained in:
@@ -65,4 +65,18 @@ impl SignatureRegistry {
|
||||
pub fn lookup_wasm(&self, idx: VMSharedSignatureIndex) -> Option<WasmFuncType> {
|
||||
self.index2wasm.get(&idx).cloned()
|
||||
}
|
||||
|
||||
/// Looks up both a shared Wasm function signature and its associated native
|
||||
/// `ir::Signature` within this registry.
|
||||
///
|
||||
/// Note that for this operation to be semantically correct the `idx` must
|
||||
/// have previously come from a call to `register` of this same object.
|
||||
pub fn lookup_wasm_and_native_signatures(
|
||||
&self,
|
||||
idx: VMSharedSignatureIndex,
|
||||
) -> Option<(WasmFuncType, ir::Signature)> {
|
||||
let wasm = self.lookup_wasm(idx)?;
|
||||
let native = self.lookup_native(idx)?;
|
||||
Some((wasm, native))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user