Struct cretonne_simplejit::SimpleJITBackend
[−]
[src]
pub struct SimpleJITBackend { /* fields omitted */ }
A SimpleJITBackend
implements Backend
and emits code and data into memory where it can be
directly called and accessed.
Methods
impl SimpleJITBackend
[src]
pub fn new() -> Self
[src]
Create a new SimpleJITBackend
.
pub fn with_isa(isa: Box<TargetIsa>) -> Self
[src]
Create a new SimpleJITBackend
with an arbitrary target. This is mainly
useful for testing.
SimpleJIT requires a TargetIsa
configured for non-PIC.
To create a SimpleJITBackend
for native use, use the new
constructor
instead.
Trait Implementations
impl<'simple_jit_backend> Backend for SimpleJITBackend
[src]
type CompiledFunction = SimpleJITCompiledFunction
The results of compiling a function.
type CompiledData = SimpleJITCompiledData
The results of "compiling" a data object.
type FinalizedFunction = *const u8
The completed output artifact for a function, if this is meaningful for the Backend. Read more
type FinalizedData = (*mut u8, usize)
The completed output artifact for a data object, if this is meaningful for the Backend. Read more
fn isa(&self) -> &TargetIsa
[src]
Return the TargetIsa
to compile for.
fn declare_function(&mut self, _name: &str, _linkage: Linkage)
[src]
Declare a function.
fn declare_data(&mut self, _name: &str, _linkage: Linkage, _writable: bool)
[src]
Declare a data object.
fn define_function(
&mut self,
_name: &str,
ctx: &Context,
_namespace: &ModuleNamespace<Self>,
code_size: u32
) -> Result<Self::CompiledFunction, CtonError>
[src]
&mut self,
_name: &str,
ctx: &Context,
_namespace: &ModuleNamespace<Self>,
code_size: u32
) -> Result<Self::CompiledFunction, CtonError>
Define a function, producing the function body from the given Context
. Read more
fn define_data(
&mut self,
_name: &str,
data: &DataContext,
_namespace: &ModuleNamespace<Self>
) -> Result<Self::CompiledData, CtonError>
[src]
&mut self,
_name: &str,
data: &DataContext,
_namespace: &ModuleNamespace<Self>
) -> Result<Self::CompiledData, CtonError>
Define a zero-initialized data object of the given size. Read more
fn write_data_funcaddr(
&mut self,
_data: &mut Self::CompiledData,
_offset: usize,
_what: FuncRef
)
[src]
&mut self,
_data: &mut Self::CompiledData,
_offset: usize,
_what: FuncRef
)
Write the address of what
into the data for data
at offset
. data
must refer to a defined data object. Read more
fn write_data_dataaddr(
&mut self,
_data: &mut Self::CompiledData,
_offset: usize,
_what: GlobalVar,
_usize: Addend
)
[src]
&mut self,
_data: &mut Self::CompiledData,
_offset: usize,
_what: GlobalVar,
_usize: Addend
)
Write the address of what
plus addend
into the data for data
at offset
. data
must refer to a defined data object. Read more
fn finalize_function(
&mut self,
func: &Self::CompiledFunction,
namespace: &ModuleNamespace<Self>
) -> Self::FinalizedFunction
[src]
&mut self,
func: &Self::CompiledFunction,
namespace: &ModuleNamespace<Self>
) -> Self::FinalizedFunction
Perform all outstanding relocations on the given function. This requires all Local
and Export
entities referenced to be defined. Read more
fn finalize_data(
&mut self,
data: &Self::CompiledData,
namespace: &ModuleNamespace<Self>
) -> Self::FinalizedData
[src]
&mut self,
data: &Self::CompiledData,
namespace: &ModuleNamespace<Self>
) -> Self::FinalizedData
Perform all outstanding relocations on the given data object. This requires all Local
and Export
entities referenced to be defined. Read more