Struct cranelift_wasm::DummyEnvironment [−][src]
pub struct DummyEnvironment { pub info: DummyModuleInfo, pub func_bytecode_sizes: Vec<usize>, pub module_name: Option<String>, // some fields omitted }
This ModuleEnvironment
implementation is a “naïve” one, doing essentially nothing and
emitting placeholders when forced to. Don’t try to execute code translated for this
environment, essentially here for translation debug purposes.
Fields
info: DummyModuleInfo
Module information.
func_bytecode_sizes: Vec<usize>
Vector of wasm bytecode size for each function.
module_name: Option<String>
Name of the module from the wasm file.
Implementations
impl DummyEnvironment
[src]
impl DummyEnvironment
[src]pub fn new(
config: TargetFrontendConfig,
return_mode: ReturnMode,
debug_info: bool
) -> Self
[src]
config: TargetFrontendConfig,
return_mode: ReturnMode,
debug_info: bool
) -> Self
Creates a new DummyEnvironment
instance.
pub fn func_env(&self) -> DummyFuncEnvironment<'_>
[src]
Return a DummyFuncEnvironment
for translating functions within this
DummyEnvironment
.
pub fn get_num_func_imports(&self) -> usize
[src]
Return the number of imported functions within this DummyEnvironment
.
pub fn get_func_name(&self, func_index: FuncIndex) -> Option<&str>
[src]
Return the name of the function, if a name for the function with the corresponding index exists.
pub fn test_expected_reachability(&mut self, reachability: Vec<(bool, bool)>)
[src]
Test reachability bits before and after every opcode during translation, as provided by the
FuncTranslationState
. This is generally used only for unit tests. This is applied to
every function in the module (so is likely only useful for test modules with one function).
Trait Implementations
impl<'data> ModuleEnvironment<'data> for DummyEnvironment
[src]
impl<'data> ModuleEnvironment<'data> for DummyEnvironment
[src]fn declare_type_func(
&mut self,
_wasm: WasmFuncType,
sig: Signature
) -> WasmResult<()>
[src]
&mut self,
_wasm: WasmFuncType,
sig: Signature
) -> WasmResult<()>
fn declare_func_import(
&mut self,
index: TypeIndex,
module: &'data str,
field: Option<&'data str>
) -> WasmResult<()>
[src]
&mut self,
index: TypeIndex,
module: &'data str,
field: Option<&'data str>
) -> WasmResult<()>
fn declare_func_type(&mut self, index: TypeIndex) -> WasmResult<()>
[src]
fn declare_global(&mut self, global: Global) -> WasmResult<()>
[src]
fn declare_global_import(
&mut self,
global: Global,
module: &'data str,
field: Option<&'data str>
) -> WasmResult<()>
[src]
&mut self,
global: Global,
module: &'data str,
field: Option<&'data str>
) -> WasmResult<()>
fn declare_table(&mut self, table: Table) -> WasmResult<()>
[src]
fn declare_table_import(
&mut self,
table: Table,
module: &'data str,
field: Option<&'data str>
) -> WasmResult<()>
[src]
&mut self,
table: Table,
module: &'data str,
field: Option<&'data str>
) -> WasmResult<()>
fn declare_table_elements(
&mut self,
_table_index: TableIndex,
_base: Option<GlobalIndex>,
_offset: usize,
_elements: Box<[FuncIndex]>
) -> WasmResult<()>
[src]
&mut self,
_table_index: TableIndex,
_base: Option<GlobalIndex>,
_offset: usize,
_elements: Box<[FuncIndex]>
) -> WasmResult<()>
fn declare_passive_element(
&mut self,
_elem_index: ElemIndex,
_segments: Box<[FuncIndex]>
) -> WasmResult<()>
[src]
&mut self,
_elem_index: ElemIndex,
_segments: Box<[FuncIndex]>
) -> WasmResult<()>
fn declare_passive_data(
&mut self,
_elem_index: DataIndex,
_segments: &'data [u8]
) -> WasmResult<()>
[src]
&mut self,
_elem_index: DataIndex,
_segments: &'data [u8]
) -> WasmResult<()>
fn declare_memory(&mut self, memory: Memory) -> WasmResult<()>
[src]
fn declare_memory_import(
&mut self,
memory: Memory,
module: &'data str,
field: Option<&'data str>
) -> WasmResult<()>
[src]
&mut self,
memory: Memory,
module: &'data str,
field: Option<&'data str>
) -> WasmResult<()>
fn declare_data_initialization(
&mut self,
_memory_index: MemoryIndex,
_base: Option<GlobalIndex>,
_offset: usize,
_data: &'data [u8]
) -> WasmResult<()>
[src]
&mut self,
_memory_index: MemoryIndex,
_base: Option<GlobalIndex>,
_offset: usize,
_data: &'data [u8]
) -> WasmResult<()>
fn declare_func_export(
&mut self,
func_index: FuncIndex,
name: &'data str
) -> WasmResult<()>
[src]
&mut self,
func_index: FuncIndex,
name: &'data str
) -> WasmResult<()>
fn declare_table_export(
&mut self,
table_index: TableIndex,
name: &'data str
) -> WasmResult<()>
[src]
&mut self,
table_index: TableIndex,
name: &'data str
) -> WasmResult<()>
fn declare_memory_export(
&mut self,
memory_index: MemoryIndex,
name: &'data str
) -> WasmResult<()>
[src]
&mut self,
memory_index: MemoryIndex,
name: &'data str
) -> WasmResult<()>
fn declare_global_export(
&mut self,
global_index: GlobalIndex,
name: &'data str
) -> WasmResult<()>
[src]
&mut self,
global_index: GlobalIndex,
name: &'data str
) -> WasmResult<()>
fn declare_start_func(&mut self, func_index: FuncIndex) -> WasmResult<()>
[src]
fn define_function_body(
&mut self,
validator: FuncValidator<ValidatorResources>,
body: FunctionBody<'data>
) -> WasmResult<()>
[src]
&mut self,
validator: FuncValidator<ValidatorResources>,
body: FunctionBody<'data>
) -> WasmResult<()>
fn declare_module_name(&mut self, name: &'data str)
[src]
fn declare_func_name(&mut self, func_index: FuncIndex, name: &'data str)
[src]
fn wasm_features(&self) -> WasmFeatures
[src]
fn reserve_types(&mut self, _num: u32) -> WasmResult<()>
[src]
fn declare_type_module(
&mut self,
imports: &[(&'data str, Option<&'data str>, EntityType)],
exports: &[(&'data str, EntityType)]
) -> WasmResult<()>
[src]
&mut self,
imports: &[(&'data str, Option<&'data str>, EntityType)],
exports: &[(&'data str, EntityType)]
) -> WasmResult<()>
fn declare_type_instance(
&mut self,
exports: &[(&'data str, EntityType)]
) -> WasmResult<()>
[src]
&mut self,
exports: &[(&'data str, EntityType)]
) -> WasmResult<()>
fn type_to_signature(&self, index: TypeIndex) -> WasmResult<SignatureIndex>
[src]
fn type_to_module_type(&self, index: TypeIndex) -> WasmResult<ModuleTypeIndex>
[src]
fn type_to_instance_type(
&self,
index: TypeIndex
) -> WasmResult<InstanceTypeIndex>
[src]
&self,
index: TypeIndex
) -> WasmResult<InstanceTypeIndex>
fn reserve_imports(&mut self, _num: u32) -> WasmResult<()>
[src]
fn declare_event_import(
&mut self,
event: Event,
module: &'data str,
field: Option<&'data str>
) -> WasmResult<()>
[src]
&mut self,
event: Event,
module: &'data str,
field: Option<&'data str>
) -> WasmResult<()>
fn declare_module_import(
&mut self,
ty_index: TypeIndex,
module: &'data str,
field: Option<&'data str>
) -> WasmResult<()>
[src]
&mut self,
ty_index: TypeIndex,
module: &'data str,
field: Option<&'data str>
) -> WasmResult<()>
fn declare_instance_import(
&mut self,
ty_index: TypeIndex,
module: &'data str,
field: Option<&'data str>
) -> WasmResult<()>
[src]
&mut self,
ty_index: TypeIndex,
module: &'data str,
field: Option<&'data str>
) -> WasmResult<()>
fn finish_imports(&mut self) -> WasmResult<()>
[src]
fn reserve_func_types(&mut self, _num: u32) -> WasmResult<()>
[src]
fn reserve_tables(&mut self, _num: u32) -> WasmResult<()>
[src]
fn reserve_memories(&mut self, _num: u32) -> WasmResult<()>
[src]
fn reserve_events(&mut self, _num: u32) -> WasmResult<()>
[src]
fn declare_event(&mut self, event: Event) -> WasmResult<()>
[src]
fn reserve_globals(&mut self, _num: u32) -> WasmResult<()>
[src]
fn reserve_exports(&mut self, _num: u32) -> WasmResult<()>
[src]
fn declare_event_export(
&mut self,
event_index: EventIndex,
name: &'data str
) -> WasmResult<()>
[src]
&mut self,
event_index: EventIndex,
name: &'data str
) -> WasmResult<()>
fn declare_instance_export(
&mut self,
index: InstanceIndex,
name: &'data str
) -> WasmResult<()>
[src]
&mut self,
index: InstanceIndex,
name: &'data str
) -> WasmResult<()>
fn declare_module_export(
&mut self,
index: ModuleIndex,
name: &'data str
) -> WasmResult<()>
[src]
&mut self,
index: ModuleIndex,
name: &'data str
) -> WasmResult<()>
fn finish_exports(&mut self) -> WasmResult<()>
[src]
fn reserve_table_elements(&mut self, _num: u32) -> WasmResult<()>
[src]
fn reserve_passive_data(&mut self, count: u32) -> WasmResult<()>
[src]
fn reserve_function_bodies(&mut self, bodies: u32, code_section_offset: u64)
[src]
fn reserve_data_initializers(&mut self, _num: u32) -> WasmResult<()>
[src]
fn declare_local_name(
&mut self,
_func_index: FuncIndex,
_local_index: u32,
_name: &'data str
)
[src]
&mut self,
_func_index: FuncIndex,
_local_index: u32,
_name: &'data str
)
fn custom_section(
&mut self,
_name: &'data str,
_data: &'data [u8]
) -> WasmResult<()>
[src]
&mut self,
_name: &'data str,
_data: &'data [u8]
) -> WasmResult<()>
fn reserve_modules(&mut self, amount: u32)
[src]
fn declare_module(&mut self, ty: TypeIndex) -> WasmResult<()>
[src]
fn module_start(&mut self, index: usize)
[src]
fn module_end(&mut self, index: usize)
[src]
fn reserve_instances(&mut self, amount: u32)
[src]
fn declare_instance(
&mut self,
module: ModuleIndex,
args: Vec<EntityIndex>
) -> WasmResult<()>
[src]
&mut self,
module: ModuleIndex,
args: Vec<EntityIndex>
) -> WasmResult<()>
fn declare_alias(&mut self, alias: Alias) -> WasmResult<()>
[src]
impl TargetEnvironment for DummyEnvironment
[src]
impl TargetEnvironment for DummyEnvironment
[src]