pub struct EngineInner {
compiler: Option<Box<dyn Compiler>>,
features: Features,
code_memory: Vec<CodeMemory>,
elf_mapped_binary: Vec<MemoryMappedBinary>,
signatures: SignatureRegistry,
}Expand description
The inner contents of Engine
Fields§
§compiler: Option<Box<dyn Compiler>>The compiler and cpu features
features: FeaturesThe compiler and cpu features
code_memory: Vec<CodeMemory>The code memory is responsible of publishing the compiled functions to memory.
elf_mapped_binary: Vec<MemoryMappedBinary>Memory-mapped ELF artifact image, produced by --experimental-artifact.
signatures: SignatureRegistryThe signature registry is used mainly to operate with trampolines performantly.
Implementations§
Source§impl EngineInner
impl EngineInner
Sourcepub fn compiler(&self) -> Result<&dyn Compiler, CompileError>
pub fn compiler(&self) -> Result<&dyn Compiler, CompileError>
Gets the compiler associated to this engine.
Sourcepub(crate) fn allocate<'a, FunctionBody, CustomSection>(
&'a mut self,
_module: &ModuleInfo,
functions: impl ExactSizeIterator<Item = &'a FunctionBody> + 'a,
function_call_trampolines: impl ExactSizeIterator<Item = &'a FunctionBody> + 'a,
dynamic_function_trampolines: impl ExactSizeIterator<Item = &'a FunctionBody> + 'a,
custom_sections: impl ExactSizeIterator<Item = &'a CustomSection> + Clone + 'a,
) -> Result<(PrimaryMap<LocalFunctionIndex, FunctionExtent>, PrimaryMap<SignatureIndex, VMTrampoline>, PrimaryMap<FunctionIndex, FunctionBodyPtr>, PrimaryMap<SectionIndex, SectionBodyPtr>), CompileError>where
FunctionBody: FunctionBodyLike<'a> + 'a,
CustomSection: CustomSectionLike<'a> + 'a,
pub(crate) fn allocate<'a, FunctionBody, CustomSection>(
&'a mut self,
_module: &ModuleInfo,
functions: impl ExactSizeIterator<Item = &'a FunctionBody> + 'a,
function_call_trampolines: impl ExactSizeIterator<Item = &'a FunctionBody> + 'a,
dynamic_function_trampolines: impl ExactSizeIterator<Item = &'a FunctionBody> + 'a,
custom_sections: impl ExactSizeIterator<Item = &'a CustomSection> + Clone + 'a,
) -> Result<(PrimaryMap<LocalFunctionIndex, FunctionExtent>, PrimaryMap<SignatureIndex, VMTrampoline>, PrimaryMap<FunctionIndex, FunctionBodyPtr>, PrimaryMap<SectionIndex, SectionBodyPtr>), CompileError>where
FunctionBody: FunctionBodyLike<'a> + 'a,
CustomSection: CustomSectionLike<'a> + 'a,
Allocate compiled functions into memory
Sourcepub(crate) fn publish_compiled_code(&mut self)
pub(crate) fn publish_compiled_code(&mut self)
Make memory containing compiled code executable.
Sourcepub(crate) fn publish_eh_frame(
&mut self,
eh_frame: Option<&[u8]>,
) -> Result<(), CompileError>
pub(crate) fn publish_eh_frame( &mut self, eh_frame: Option<&[u8]>, ) -> Result<(), CompileError>
Register DWARF-type exception handling information associated with the code.
Sourcepub(crate) fn map_elf_binary<'a, R: ReadRef<'a>>(
&mut self,
object_file: &File<'a, R>,
data: &[u8],
) -> Result<*mut c_void, CompileError>
pub(crate) fn map_elf_binary<'a, R: ReadRef<'a>>( &mut self, object_file: &File<'a, R>, data: &[u8], ) -> Result<*mut c_void, CompileError>
Memory-map a compiled ELF artifact image, keeping the mapping alive for the lifetime of the engine. Returns the base address of the mapping, which section/symbol offsets from the image are relative to.
Sourcepub(crate) fn map_elf_binary_file<'a, R: ReadRef<'a>>(
&mut self,
object_file: &File<'a, R>,
file: RawFd,
) -> Result<*mut c_void, CompileError>
pub(crate) fn map_elf_binary_file<'a, R: ReadRef<'a>>( &mut self, object_file: &File<'a, R>, file: RawFd, ) -> Result<*mut c_void, CompileError>
Memory-map a compiled ELF artifact directly from a file.
Sourcepub(crate) fn publish_elf_eh_frame(
&mut self,
address: u64,
size: u64,
) -> Result<(), CompileError>
pub(crate) fn publish_elf_eh_frame( &mut self, address: u64, size: u64, ) -> Result<(), CompileError>
Register DWARF-type exception handling information associated with the code.
Sourcepub fn signatures(&self) -> &SignatureRegistry
pub fn signatures(&self) -> &SignatureRegistry
Shared signature registry.
Sourcepub(crate) fn register_frame_info(
&mut self,
frame_info: GlobalFrameInfoRegistration,
)
pub(crate) fn register_frame_info( &mut self, frame_info: GlobalFrameInfoRegistration, )
Register the frame info for the code memory
Sourcepub(crate) fn register_elf_frame_info(
&mut self,
frame_info: GlobalFrameInfoRegistration,
)
pub(crate) fn register_elf_frame_info( &mut self, frame_info: GlobalFrameInfoRegistration, )
Register the frame info for the most recently mapped ELF binary.
pub(crate) fn register_perfmap( &self, finished_functions: &PrimaryMap<LocalFunctionIndex, FunctionExtent>, module_info: &ModuleInfo, ) -> Result<(), CompileError>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for EngineInner
impl !RefUnwindSafe for EngineInner
impl Send for EngineInner
impl !Sync for EngineInner
impl Unpin for EngineInner
impl !UnwindSafe for EngineInner
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more