[−][src]Struct wasmer_clif_fork_wasm::TranslationState
Contains information passed along during the translation and that records:
- The current value and control stacks.
- The depth of the two unreachable control blocks stacks, that are manipulated when translating unreachable code;
Fields
stack: Vec<Value>
Stack
control_stack: Vec<ControlStackFrame>
Control stack
reachable: bool
Reachability
Methods
impl TranslationState
[src]
pub fn new() -> Self
[src]
New TranslationState
pub fn initialize(&mut self, sig: &Signature, exit_block: Ebb)
[src]
Initialize the state for compiling a function with the given signature.
This resets the state to containing only a single block representing the whole function. The exit block is the last block in the function which will contain the return instruction.
pub fn push1(&mut self, val: Value)
[src]
Push a value.
pub fn pushn(&mut self, vals: &[Value])
[src]
Push multiple values.
pub fn pop1(&mut self) -> Value
[src]
Pop one value.
pub fn peek1(&self) -> Value
[src]
Peek at the top of the stack without popping it.
pub fn pop2(&mut self) -> (Value, Value)
[src]
Pop two values. Return them in the order they were pushed.
pub fn pop3(&mut self) -> (Value, Value, Value)
[src]
Pop three values. Return them in the order they were pushed.
pub fn popn(&mut self, n: usize)
[src]
Pop the top n
values on the stack.
The popped values are not returned. Use peekn
to look at them before popping.
pub fn peekn(&self, n: usize) -> &[Value]
[src]
Peek at the top n
values on the stack in the order they were pushed.
pub fn push_block(&mut self, following_code: Ebb, num_result_types: usize)
[src]
Push a block on the control stack.
pub fn push_loop(
&mut self,
header: Ebb,
following_code: Ebb,
num_result_types: usize
)
[src]
&mut self,
header: Ebb,
following_code: Ebb,
num_result_types: usize
)
Push a loop on the control stack.
pub fn push_if(
&mut self,
branch_inst: Inst,
following_code: Ebb,
num_result_types: usize
)
[src]
&mut self,
branch_inst: Inst,
following_code: Ebb,
num_result_types: usize
)
Push an if on the control stack.
impl TranslationState
[src]
Methods for handling entity references.
pub fn get_global<FE: FuncEnvironment + ?Sized>(
&mut self,
func: &mut Function,
index: u32,
environ: &mut FE
) -> WasmResult<GlobalVariable>
[src]
&mut self,
func: &mut Function,
index: u32,
environ: &mut FE
) -> WasmResult<GlobalVariable>
Get the GlobalVariable
reference that should be used to access the global variable
index
. Create the reference if necessary.
Also return the WebAssembly type of the global.
pub fn get_heap<FE: FuncEnvironment + ?Sized>(
&mut self,
func: &mut Function,
index: u32,
environ: &mut FE
) -> WasmResult<Heap>
[src]
&mut self,
func: &mut Function,
index: u32,
environ: &mut FE
) -> WasmResult<Heap>
Get the Heap
reference that should be used to access linear memory index
.
Create the reference if necessary.
pub fn get_table<FE: FuncEnvironment + ?Sized>(
&mut self,
func: &mut Function,
index: u32,
environ: &mut FE
) -> WasmResult<Table>
[src]
&mut self,
func: &mut Function,
index: u32,
environ: &mut FE
) -> WasmResult<Table>
Get the Table
reference that should be used to access table index
.
Create the reference if necessary.
pub fn get_indirect_sig<FE: FuncEnvironment + ?Sized>(
&mut self,
func: &mut Function,
index: u32,
environ: &mut FE
) -> WasmResult<(SigRef, usize)>
[src]
&mut self,
func: &mut Function,
index: u32,
environ: &mut FE
) -> WasmResult<(SigRef, usize)>
Get the SigRef
reference that should be used to make an indirect call with signature
index
. Also return the number of WebAssembly arguments in the signature.
Create the signature if necessary.
pub fn get_direct_func<FE: FuncEnvironment + ?Sized>(
&mut self,
func: &mut Function,
index: u32,
environ: &mut FE
) -> WasmResult<(FuncRef, usize)>
[src]
&mut self,
func: &mut Function,
index: u32,
environ: &mut FE
) -> WasmResult<(FuncRef, usize)>
Get the FuncRef
reference that should be used to make a direct call to function
index
. Also return the number of WebAssembly arguments in the signature.
Create the function reference if necessary.
Auto Trait Implementations
impl Send for TranslationState
impl Sync for TranslationState
impl Unpin for TranslationState
impl RefUnwindSafe for TranslationState
impl UnwindSafe for TranslationState
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,