cranelift-wasm: Allow more customization of ref type representations
* Allow different Cranelift IR types to be used for different Wasm reference types. * Do not assume that all Wasm reference types are always a Cranelift IR reference type. For example, `funcref`s might not need GC in some implementations, and can therefore be represented with a pointer rather than a reference type.
This commit is contained in:
@@ -197,6 +197,14 @@ impl<'dummy_environment> DummyFuncEnvironment<'dummy_environment> {
|
||||
));
|
||||
sig
|
||||
}
|
||||
|
||||
fn reference_type(&self) -> ir::Type {
|
||||
match self.pointer_type() {
|
||||
ir::types::I32 => ir::types::R32,
|
||||
ir::types::I64 => ir::types::R64,
|
||||
_ => panic!("unsupported pointer type"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'dummy_environment> TargetEnvironment for DummyFuncEnvironment<'dummy_environment> {
|
||||
|
||||
Reference in New Issue
Block a user