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:
@@ -196,8 +196,7 @@ fn declare_locals<FE: FuncEnvironment + ?Sized>(
|
||||
let constant_handle = builder.func.dfg.constants.insert([0; 16].to_vec().into());
|
||||
builder.ins().vconst(ir::types::I8X16, constant_handle)
|
||||
}
|
||||
ExternRef => builder.ins().null(environ.reference_type()),
|
||||
FuncRef => builder.ins().null(environ.reference_type()),
|
||||
ExternRef | FuncRef => environ.translate_ref_null(builder.cursor(), wasm_type)?,
|
||||
ty => return Err(wasm_unsupported!("unsupported local type {:?}", ty)),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user