pub struct VMOffsets<P> {Show 14 fields
pub ptr: P,
pub num_imported_functions: u32,
pub num_imported_tables: u32,
pub num_imported_memories: u32,
pub num_imported_globals: u32,
pub num_imported_tags: u32,
pub num_defined_tables: u32,
pub num_defined_memories: u32,
pub num_owned_memories: u32,
pub num_defined_globals: u32,
pub num_defined_tags: u32,
pub num_escaped_funcs: u32,
pub num_runtime_data: u32,
pub has_startup_func: bool,
/* private fields */
}Expand description
This class computes offsets to fields within VMContext and other
related structs that JIT code accesses directly.
Fields§
§ptr: PThe size in bytes of a pointer on the target.
num_imported_functions: u32The number of imported functions in the module.
num_imported_tables: u32The number of imported tables in the module.
num_imported_memories: u32The number of imported memories in the module.
num_imported_globals: u32The number of imported globals in the module.
The number of imported tags in the module.
num_defined_tables: u32The number of defined tables in the module.
num_defined_memories: u32The number of defined memories in the module.
num_owned_memories: u32The number of memories owned by the module instance.
num_defined_globals: u32The number of defined globals in the module.
The number of defined tags in the module.
num_escaped_funcs: u32The number of escaped functions in the module, the size of the func_refs array.
num_runtime_data: u32The number of runtime data segments in the module.
has_startup_func: boolWhether or not the module has a start function.
Implementations§
Source§impl<P: PtrSize> VMOffsets<P>
impl<P: PtrSize> VMOffsets<P>
Sourcepub fn new(ptr: P, module: &Module) -> Self
pub fn new(ptr: P, module: &Module) -> Self
Return a new VMOffsets instance, for a given pointer size.
Sourcepub fn pointer_size(&self) -> u8
pub fn pointer_size(&self) -> u8
Returns the size, in bytes, of the target
Sourcepub fn region_sizes(&self) -> impl Iterator<Item = (&str, u32)>
pub fn region_sizes(&self) -> impl Iterator<Item = (&str, u32)>
Returns an iterator which provides a human readable description and a
byte size. The iterator returned will iterate over the bytes allocated
to the entire VMOffsets structure to explain where each byte size is
coming from.
Source§impl<P: PtrSize> VMOffsets<P>
Offsets for *const VMFunctionBody.
impl<P: PtrSize> VMOffsets<P>
Offsets for *const VMFunctionBody.
Sourcepub fn size_of_vmfunction_body_ptr(&self) -> u8
pub fn size_of_vmfunction_body_ptr(&self) -> u8
The size of the current_elements field.
Source§impl<P: PtrSize> VMOffsets<P>
Offsets for VMTableDefinition.
impl<P: PtrSize> VMOffsets<P>
Offsets for VMTableDefinition.
Sourcepub fn size_of_vmtable_definition_current_elements(&self) -> u8
pub fn size_of_vmtable_definition_current_elements(&self) -> u8
The size of the current_elements field.
Source§impl<P: PtrSize> VMOffsets<P>
Offsets for VMSharedTypeIndex.
impl<P: PtrSize> VMOffsets<P>
Offsets for VMSharedTypeIndex.
Return the size of VMSharedTypeIndex.
Source§impl<P: PtrSize> VMOffsets<P>
Offsets of the dynamically-positioned fields of VMContext.
impl<P: PtrSize> VMOffsets<P>
Offsets of the dynamically-positioned fields of VMContext.
Sourcepub fn imported_memories(&self) -> ArrayOffsets<MemoryIndex>
pub fn imported_memories(&self) -> ArrayOffsets<MemoryIndex>
The offsets of the imported_memories array.
Sourcepub fn memories(&self) -> ArrayOffsets<DefinedMemoryIndex>
pub fn memories(&self) -> ArrayOffsets<DefinedMemoryIndex>
The offsets of the memories array.
Sourcepub fn owned_memories(&self) -> ArrayOffsets<OwnedMemoryIndex>
pub fn owned_memories(&self) -> ArrayOffsets<OwnedMemoryIndex>
The offsets of the owned_memories array.
Sourcepub fn imported_functions(&self) -> ArrayOffsets<FuncIndex>
pub fn imported_functions(&self) -> ArrayOffsets<FuncIndex>
The offsets of the imported_functions array.
Sourcepub fn imported_tables(&self) -> ArrayOffsets<TableIndex>
pub fn imported_tables(&self) -> ArrayOffsets<TableIndex>
The offsets of the imported_tables array.
Sourcepub fn imported_globals(&self) -> ArrayOffsets<GlobalIndex>
pub fn imported_globals(&self) -> ArrayOffsets<GlobalIndex>
The offsets of the imported_globals array.
The offsets of the imported_tags array.
Sourcepub fn tables(&self) -> ArrayOffsets<DefinedTableIndex>
pub fn tables(&self) -> ArrayOffsets<DefinedTableIndex>
The offsets of the tables array.
Sourcepub fn globals(&self) -> ArrayOffsets<DefinedGlobalIndex>
pub fn globals(&self) -> ArrayOffsets<DefinedGlobalIndex>
The offsets of the globals array.
The offsets of the tags array.
Sourcepub fn func_refs(&self) -> ArrayOffsets<FuncRefIndex>
pub fn func_refs(&self) -> ArrayOffsets<FuncRefIndex>
The offsets of the func_refs array.
Sourcepub fn startup_func_ref(&self) -> u32
pub fn startup_func_ref(&self) -> u32
The offset of the startup_func_ref field.
Panics if has_startup_func is false, in which case this field is not present at all.
Sourcepub fn runtime_data_bases(&self) -> ArrayOffsets<RuntimeDataIndex>
pub fn runtime_data_bases(&self) -> ArrayOffsets<RuntimeDataIndex>
The offsets of the runtime_data_bases array.
Sourcepub fn runtime_data_lengths(&self) -> ArrayOffsets<RuntimeDataIndex>
pub fn runtime_data_lengths(&self) -> ArrayOffsets<RuntimeDataIndex>
The offsets of the runtime_data_lengths array.
Sourcepub fn size_of_vmctx(&self) -> u32
pub fn size_of_vmctx(&self) -> u32
Return the size of the VMContext allocation.
Source§impl<P: PtrSize> VMOffsets<P>
Offsets for VMGcHeader.
impl<P: PtrSize> VMOffsets<P>
Offsets for VMGcHeader.
Sourcepub fn vm_gc_header_kind(&self) -> u32
pub fn vm_gc_header_kind(&self) -> u32
Return the offset for the VMGcHeader::kind field.
Sourcepub fn vm_gc_header_reserved_bits(&self) -> u32
pub fn vm_gc_header_reserved_bits(&self) -> u32
Return the offset for the VMGcHeader’s reserved bits.
Sourcepub fn vm_gc_header_ty(&self) -> u32
pub fn vm_gc_header_ty(&self) -> u32
Return the offset for the VMGcHeader::ty field.
Source§impl<P: PtrSize> VMOffsets<P>
Offsets for VMDrcHeader.
impl<P: PtrSize> VMOffsets<P>
Offsets for VMDrcHeader.
Should only be used when the DRC collector is enabled.
Sourcepub fn vm_drc_header_ref_count(&self) -> u32
pub fn vm_drc_header_ref_count(&self) -> u32
Return the offset for VMDrcHeader::ref_count.
Sourcepub fn vm_drc_header_next_over_approximated_stack_root(&self) -> u32
pub fn vm_drc_header_next_over_approximated_stack_root(&self) -> u32
Return the offset for VMDrcHeader::next_over_approximated_stack_root.