Struct cretonne_wasm::DummyEnvironment
[−]
[src]
pub struct DummyEnvironment { pub info: DummyModuleInfo, pub func_bytecode_sizes: Vec<usize>, // 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.
Methods
impl DummyEnvironment
[src]
pub fn default() -> Self
[src]
Allocates the data structures with default flags.
pub fn with_flags(flags: Flags) -> Self
[src]
Allocates the data structures with the given flags.
pub fn func_env(&self) -> DummyFuncEnvironment
[src]
Return a DummyFuncEnvironment
for translating functions within this
DummyEnvironment
.
Trait Implementations
impl<'data> ModuleEnvironment<'data> for DummyEnvironment
[src]
fn get_func_name(&self, func_index: FunctionIndex) -> ExternalName
[src]
Return the name for the given function index.
fn declare_signature(&mut self, sig: &Signature)
[src]
Declares a function signature to the environment.
fn get_signature(&self, sig_index: SignatureIndex) -> &Signature
[src]
Return the signature with the given index.
fn declare_func_import(
&mut self,
sig_index: SignatureIndex,
module: &'data str,
field: &'data str
)
[src]
&mut self,
sig_index: SignatureIndex,
module: &'data str,
field: &'data str
)
Declares a function import to the environment.
fn get_num_func_imports(&self) -> usize
[src]
Return the number of imported funcs.
fn declare_func_type(&mut self, sig_index: SignatureIndex)
[src]
Declares the type (signature) of a local function in the module.
fn get_func_type(&self, func_index: FunctionIndex) -> SignatureIndex
[src]
Return the signature index for the given function index.
fn declare_global(&mut self, global: Global)
[src]
Declares a global to the environment.
fn get_global(&self, global_index: GlobalIndex) -> &Global
[src]
Return the global for the given global index.
fn declare_table(&mut self, table: Table)
[src]
Declares a table to the environment.
fn declare_table_elements(
&mut self,
_table_index: TableIndex,
_base: Option<GlobalIndex>,
_offset: usize,
_elements: Vec<FunctionIndex>
)
[src]
&mut self,
_table_index: TableIndex,
_base: Option<GlobalIndex>,
_offset: usize,
_elements: Vec<FunctionIndex>
)
Fills a declared table with references to functions in the module.
fn declare_memory(&mut self, memory: Memory)
[src]
Declares a memory to the environment
fn declare_data_initialization(
&mut self,
_memory_index: MemoryIndex,
_base: Option<GlobalIndex>,
_offset: usize,
_data: &'data [u8]
)
[src]
&mut self,
_memory_index: MemoryIndex,
_base: Option<GlobalIndex>,
_offset: usize,
_data: &'data [u8]
)
Fills a declared memory with bytes at module instantiation.
fn declare_func_export(&mut self, func_index: FunctionIndex, name: &'data str)
[src]
Declares a function export to the environment.
fn declare_table_export(&mut self, table_index: TableIndex, name: &'data str)
[src]
Declares a table export to the environment.
fn declare_memory_export(&mut self, memory_index: MemoryIndex, name: &'data str)
[src]
Declares a memory export to the environment.
fn declare_global_export(&mut self, global_index: GlobalIndex, name: &'data str)
[src]
Declares a global export to the environment.
fn declare_start_func(&mut self, func_index: FunctionIndex)
[src]
Declares a start function.
fn define_function_body(
&mut self,
body_bytes: &'data [u8]
) -> Result<(), String>
[src]
&mut self,
body_bytes: &'data [u8]
) -> Result<(), String>
Provides the contents of a function body.