Struct cranelift_simplejit::SimpleJITBackend
source · pub struct SimpleJITBackend { /* private fields */ }
Expand description
A SimpleJITBackend
implements Backend
and emits code and data into memory where it can be
directly called and accessed.
See the SimpleJITBuilder
for a convenient way to construct SimpleJITBackend
instances.
Trait Implementations
sourceimpl<'simple_jit_backend> Backend for SimpleJITBackend
impl<'simple_jit_backend> Backend for SimpleJITBackend
type CompiledFunction = SimpleJITCompiledFunction
type CompiledFunction = SimpleJITCompiledFunction
SimpleJIT compiled function and data objects may have outstanding
relocations that need to be performed before the memory can be used.
These relocations are performed within finalize_function
and
finalize_data
.
type FinalizedFunction = *const u8
type FinalizedFunction = *const u8
SimpleJIT emits code and data into memory, and provides raw pointers to them.
type Product = ()
type Product = ()
SimpleJIT emits code and data into memory as it processes them, so it
doesn’t need to provide anything after the Module
is complete.
sourcefn new(builder: SimpleJITBuilder) -> Self
fn new(builder: SimpleJITBuilder) -> Self
Create a new SimpleJITBackend
.
sourcefn finish(self)
fn finish(self)
SimpleJIT emits code and data into memory as it processes them, so it
doesn’t need to provide anything after the Module
is complete.
type Builder = SimpleJITBuilder
type Builder = SimpleJITBuilder
Backend
instances.type CompiledData = SimpleJITCompiledData
type CompiledData = SimpleJITCompiledData
type FinalizedData = (*mut u8, usize)
type FinalizedData = (*mut u8, usize)
Backend
. Read moresourcefn declare_function(&mut self, _name: &str, _linkage: Linkage)
fn declare_function(&mut self, _name: &str, _linkage: Linkage)
sourcefn declare_data(&mut self, _name: &str, _linkage: Linkage, _writable: bool)
fn declare_data(&mut self, _name: &str, _linkage: Linkage, _writable: bool)
sourcefn define_function(
&mut self,
name: &str,
ctx: &Context,
_namespace: &ModuleNamespace<'_, Self>,
code_size: u32
) -> ModuleResult<Self::CompiledFunction>
fn define_function(
&mut self,
name: &str,
ctx: &Context,
_namespace: &ModuleNamespace<'_, Self>,
code_size: u32
) -> ModuleResult<Self::CompiledFunction>
Context
. Read moresourcefn define_data(
&mut self,
_name: &str,
writable: bool,
data: &DataContext,
_namespace: &ModuleNamespace<'_, Self>
) -> ModuleResult<Self::CompiledData>
fn define_data(
&mut self,
_name: &str,
writable: bool,
data: &DataContext,
_namespace: &ModuleNamespace<'_, Self>
) -> ModuleResult<Self::CompiledData>
sourcefn write_data_funcaddr(
&mut self,
_data: &mut Self::CompiledData,
_offset: usize,
_what: FuncRef
)
fn write_data_funcaddr(
&mut self,
_data: &mut Self::CompiledData,
_offset: usize,
_what: FuncRef
)
what
into the data for data
at offset
. data
must refer to a
defined data object. Read moresourcefn write_data_dataaddr(
&mut self,
_data: &mut Self::CompiledData,
_offset: usize,
_what: GlobalValue,
_usize: Addend
)
fn write_data_dataaddr(
&mut self,
_data: &mut Self::CompiledData,
_offset: usize,
_what: GlobalValue,
_usize: Addend
)
what
plus addend
into the data for data
at offset
. data
must
refer to a defined data object. Read moresourcefn finalize_function(
&mut self,
func: &Self::CompiledFunction,
namespace: &ModuleNamespace<'_, Self>
) -> Self::FinalizedFunction
fn finalize_function(
&mut self,
func: &Self::CompiledFunction,
namespace: &ModuleNamespace<'_, Self>
) -> Self::FinalizedFunction
Local
and Export
entities referenced to be defined. Read moresourcefn get_finalized_function(
&self,
func: &Self::CompiledFunction
) -> Self::FinalizedFunction
fn get_finalized_function(
&self,
func: &Self::CompiledFunction
) -> Self::FinalizedFunction
sourcefn finalize_data(
&mut self,
data: &Self::CompiledData,
namespace: &ModuleNamespace<'_, Self>
) -> Self::FinalizedData
fn finalize_data(
&mut self,
data: &Self::CompiledData,
namespace: &ModuleNamespace<'_, Self>
) -> Self::FinalizedData
Local
and Export
entities referenced to be defined. Read more