Path: blob/main/crates/cranelift/src/func_environ/gc/disabled.rs
3124 views
//! `GcCompiler` implementation when GC support is disabled.12use super::GcCompiler;3use crate::func_environ::{Extension, FuncEnvironment};4use cranelift_codegen::ir;5use cranelift_frontend::FunctionBuilder;6use smallvec::SmallVec;7use wasmtime_environ::{TagIndex, TypeIndex, WasmRefType, WasmResult, wasm_unsupported};89fn disabled<T>() -> WasmResult<T> {10Err(wasm_unsupported!(11"support for Wasm GC disabled at compile time because the `gc` cargo \12feature was not enabled"13))14}1516/// Get the default GC compiler.17pub fn gc_compiler(_: &FuncEnvironment<'_>) -> WasmResult<Box<dyn GcCompiler>> {18disabled()19}2021pub fn translate_struct_new(22_func_env: &mut FuncEnvironment<'_>,23_builder: &mut FunctionBuilder<'_>,24_struct_type_index: TypeIndex,25_fields: &[ir::Value],26) -> WasmResult<ir::Value> {27disabled()28}2930pub fn translate_struct_new_default(31_func_env: &mut FuncEnvironment<'_>,32_builder: &mut FunctionBuilder<'_>,33_struct_type_index: TypeIndex,34) -> WasmResult<ir::Value> {35disabled()36}3738pub fn translate_struct_get(39_func_env: &mut FuncEnvironment<'_>,40_builder: &mut FunctionBuilder<'_>,41_struct_type_index: TypeIndex,42_field_index: u32,43_struct_ref: ir::Value,44_extension: Option<Extension>,45) -> WasmResult<ir::Value> {46disabled()47}4849pub fn translate_struct_set(50_func_env: &mut FuncEnvironment<'_>,51_builder: &mut FunctionBuilder<'_>,52_struct_type_index: TypeIndex,53_field_index: u32,54_struct_ref: ir::Value,55_new_val: ir::Value,56) -> WasmResult<()> {57disabled()58}5960pub fn translate_exn_unbox(61_func_env: &mut FuncEnvironment<'_>,62_builder: &mut FunctionBuilder<'_>,63_tag_index: TagIndex,64_exn_ref: ir::Value,65) -> WasmResult<SmallVec<[ir::Value; 4]>> {66disabled()67}6869pub fn translate_exn_throw(70_func_env: &mut FuncEnvironment<'_>,71_builder: &mut FunctionBuilder<'_>,72_tag_index: TagIndex,73_args: &[ir::Value],74) -> WasmResult<()> {75disabled()76}7778pub fn translate_exn_throw_ref(79_func_env: &mut FuncEnvironment<'_>,80_builder: &mut FunctionBuilder<'_>,81_exnref: ir::Value,82) -> WasmResult<()> {83disabled()84}8586pub fn translate_array_new(87_func_env: &mut FuncEnvironment<'_>,88_builder: &mut FunctionBuilder,89_array_type_index: TypeIndex,90_elem: ir::Value,91_len: ir::Value,92) -> WasmResult<ir::Value> {93disabled()94}9596pub fn translate_array_new_default(97_func_env: &mut FuncEnvironment<'_>,98_builder: &mut FunctionBuilder,99_array_type_index: TypeIndex,100_len: ir::Value,101) -> WasmResult<ir::Value> {102disabled()103}104105pub fn translate_array_new_fixed(106_func_env: &mut FuncEnvironment<'_>,107_builder: &mut FunctionBuilder,108_array_type_index: TypeIndex,109_elems: &[ir::Value],110) -> WasmResult<ir::Value> {111disabled()112}113114pub fn translate_array_fill(115_func_env: &mut FuncEnvironment<'_>,116_builder: &mut FunctionBuilder<'_>,117_array_type_index: TypeIndex,118_array_ref: ir::Value,119_index: ir::Value,120_value: ir::Value,121_n: ir::Value,122) -> WasmResult<()> {123disabled()124}125126pub fn translate_array_len(127_func_env: &mut FuncEnvironment<'_>,128_builder: &mut FunctionBuilder,129_array: ir::Value,130) -> WasmResult<ir::Value> {131disabled()132}133134pub fn translate_array_get(135_func_env: &mut FuncEnvironment<'_>,136_builder: &mut FunctionBuilder,137_array_type_index: TypeIndex,138_array: ir::Value,139_index: ir::Value,140_extension: Option<Extension>,141) -> WasmResult<ir::Value> {142disabled()143}144145pub fn translate_array_set(146_func_env: &mut FuncEnvironment<'_>,147_builder: &mut FunctionBuilder,148_array_type_index: TypeIndex,149_array: ir::Value,150_index: ir::Value,151_value: ir::Value,152) -> WasmResult<()> {153disabled()154}155156pub fn translate_ref_test(157_func_env: &mut FuncEnvironment<'_>,158_builder: &mut FunctionBuilder<'_>,159_test_ty: WasmRefType,160_val: ir::Value,161_val_ty: WasmRefType,162) -> WasmResult<ir::Value> {163disabled()164}165166167