[−][src]Enum jsyc_compiler::bytecode::Operand
Represents variants of bytecode operand
There are two types of operands. Regular operands(numbers, strings or registers) and token operands. Token operands are only used by the compiler to express a dependency that cannot be calculated at the point of declaration. For example, the target of a jump is an address. However, an address can only be calculated when the entire bytecode is known. Thus, all jump instructions contain a token operand BranchAddr which holds the target label of the jump. After the compilation of this, these tokens are then replaced. Thus, token operands cannot be part of a final bytecode.
Variants
String(String)
FloatNum(f64)
LongNum(i32)
ShortNum(u8)
Reg(u8)
RegistersArray(Vec<u8>)
FunctionAddr(BytecodeAddrToken)
BranchAddr(LabelAddrToken)
FunctionArguments(FunctionArguments)
Methods
impl Operand
[src]
pub fn from_literal(literal: BytecodeLiteral) -> CompilerResult<Self>
[src]
pub fn str(string: String) -> Self
[src]
pub fn function_addr(ident: String) -> Self
[src]
pub fn branch_addr(label: Label) -> Self
[src]
pub fn bc_func_args(arg_regs: Vec<Register>) -> Self
[src]
pub fn is_worth_caching(&self) -> bool
[src]
Trait Implementations
impl ToBytes for Operand
[src]
impl PartialEq<Operand> for Operand
[src]
impl Clone for Operand
[src]
fn clone(&self) -> Operand
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Operand
[src]
impl Display for Operand
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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> 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> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,