Struct jit::Val [] [src]

pub struct Val(_);

Vals form the backbone of the storage system in LibJIT

Every value in the system, be it a constant, a local variable, or a temporary result, is represented by an object of type Val. The JIT then allocates registers or memory locations to the values as appropriate. This is why Val is always behind a reference

Methods

impl Val

fn new<'a>(func: &UncompiledFunction<'a>, value_type: &Ty) -> &'a Val

Create a new value in the context of a function's current block.

The value initially starts off as a block-specific temporary. It will be converted into a function-wide local variable if it is ever referenced from a different block.

fn get_type(&self) -> &Ty

Get the type of the value

fn get_function(&self) -> UncompiledFunction

Get the function which made this value

fn is_temp(&self) -> bool

Determine if a value is temporary. i.e. its scope extends over a single block within its function.

fn is_addressable(&self) -> bool

Determine if a value is addressable.

fn set_addressable(&self)

Set a flag on a value to indicate that it is addressable. This should be used when you want to take the address of a value (e.g. &variable in Rust/C). The value is guaranteed to not be stored in a register across a function call.

Trait Implementations

impl Eq for Val

impl PartialEq for Val

fn eq(&self, other: &Val) -> bool

fn ne(&self, other: &Rhs) -> bool

impl<'a> From<jit_value_t> for &'a Val

fn from(ty: jit_value_t) -> &'a Val

impl Debug for Val

fn fmt(&self, fmt: &mut Formatter) -> Result

impl<'a> Add<&'a Val> for &'a Val

type Output = &'a Val

fn add(self, other: &'a Val) -> &'a Val

impl<'a> BitAnd<&'a Val> for &'a Val

type Output = &'a Val

fn bitand(self, other: &'a Val) -> &'a Val

impl<'a> BitOr<&'a Val> for &'a Val

type Output = &'a Val

fn bitor(self, other: &'a Val) -> &'a Val

impl<'a> BitXor<&'a Val> for &'a Val

type Output = &'a Val

fn bitxor(self, other: &'a Val) -> &'a Val

impl<'a> Div<&'a Val> for &'a Val

type Output = &'a Val

fn div(self, other: &'a Val) -> &'a Val

impl<'a> Mul<&'a Val> for &'a Val

type Output = &'a Val

fn mul(self, other: &'a Val) -> &'a Val

impl<'a> Rem<&'a Val> for &'a Val

type Output = &'a Val

fn rem(self, other: &'a Val) -> &'a Val

impl<'a> Shl<&'a Val> for &'a Val

type Output = &'a Val

fn shl(self, other: &'a Val) -> &'a Val

impl<'a> Shr<&'a Val> for &'a Val

type Output = &'a Val

fn shr(self, other: &'a Val) -> &'a Val

impl<'a> Sub<&'a Val> for &'a Val

type Output = &'a Val

fn sub(self, other: &'a Val) -> &'a Val

impl<'a> Neg for &'a Val

type Output = &'a Val

fn neg(self) -> &'a Val

impl<'a> Not for &'a Val

type Output = &'a Val

fn not(self) -> &'a Val