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:
@@ -67,3 +67,14 @@ pub fn ref_type() -> wasmtime_environ::ir::Type {
|
||||
unreachable!()
|
||||
}
|
||||
}
|
||||
|
||||
/// The Cranelift IR type used for pointer types for this target architecture.
|
||||
pub fn pointer_type() -> wasmtime_environ::ir::Type {
|
||||
if cfg!(target_pointer_width = "32") {
|
||||
wasmtime_environ::ir::types::I32
|
||||
} else if cfg!(target_pointer_width = "64") {
|
||||
wasmtime_environ::ir::types::I64
|
||||
} else {
|
||||
unreachable!()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user