Skip to main content

BytecodeFunction

Struct BytecodeFunction 

Source
pub struct BytecodeFunction<'table> {
Show 27 fields pub max_stack_size: u8, pub num_params: u8, pub upvalue_count: u8, pub is_vararg: bool, pub flags: u8, pub type_info: Vec<u8>, pub upvalue_types: Vec<u8>, pub local_types: Vec<BytecodeTypedLocal>, pub blocks: Vec<BytecodeBlock>, pub instructions: Vec<BytecodeInstruction>, pub constants: Vec<BytecodeFunctionConstant<'table>>, pub immediates: Vec<BytecodeImmediate>, pub phis: Vec<BytecodePhi>, pub projections: Vec<BytecodeProjection>, pub registers: HashMap<BytecodeOperand, Register>, pub table_shapes: Vec<TableShape>, pub class_shapes: Vec<BytecodeClass>, pub entry_block: BytecodeBlockId, pub exit_block: BytecodeBlockId, pub pc_to_block: Vec<BytecodeBlockId>, pub pc_to_instruction: Vec<BytecodeInstructionId>, pub protos: Vec<u32>, pub line_defined: u32, pub debug_name: &'table [u8], pub lines: Vec<u32>, pub locals: Vec<BytecodeDebugLocal<'table>>, pub upvalue_names: Vec<&'table [u8]>,
}

Fields§

§max_stack_size: u8§num_params: u8§upvalue_count: u8§is_vararg: bool§flags: u8§type_info: Vec<u8>§upvalue_types: Vec<u8>§local_types: Vec<BytecodeTypedLocal>§blocks: Vec<BytecodeBlock>§instructions: Vec<BytecodeInstruction>§constants: Vec<BytecodeFunctionConstant<'table>>§immediates: Vec<BytecodeImmediate>§phis: Vec<BytecodePhi>§projections: Vec<BytecodeProjection>§registers: HashMap<BytecodeOperand, Register>§table_shapes: Vec<TableShape>§class_shapes: Vec<BytecodeClass>§entry_block: BytecodeBlockId§exit_block: BytecodeBlockId§pc_to_block: Vec<BytecodeBlockId>§pc_to_instruction: Vec<BytecodeInstructionId>§protos: Vec<u32>§line_defined: u32§debug_name: &'table [u8]§lines: Vec<u32>§locals: Vec<BytecodeDebugLocal<'table>>§upvalue_names: Vec<&'table [u8]>

Implementations§

Source§

impl<'table> BytecodeFunction<'table>

Source

pub fn from_function_bytecode<'strings>( data: &[u8], strings: &'table BytecodeStringTable<'strings>, ) -> Result<Self, BytecodeReadError>

Source

pub fn to_function_bytecode(&mut self) -> Result<Vec<u8>, BytecodeWriteError>

Convenience wrapper for Luau’s single-argument toFunctionBytecode(fn) overload.

Use BytecodeBuilder::to_function_bytecode(&mut function) when a caller already owns a builder, matching Luau’s toFunctionBytecode(bcb, fn) overload.

Source

pub fn entry(&self) -> BytecodeBlockId

Source

pub fn exit(&self) -> BytecodeBlockId

Source

pub fn blocks(&self) -> &[BytecodeBlock]

Source

pub fn block(&self, id: BytecodeBlockId) -> &BytecodeBlock

Source

pub fn graph_instruction( &self, id: BytecodeInstructionId, ) -> &BytecodeInstruction

Source

pub fn block_for_pc(&self, pc: InstructionPc) -> Option<BytecodeBlockId>

Source

pub fn instruction_for_pc( &self, pc: InstructionPc, ) -> Option<BytecodeInstructionId>

Source

pub fn immediate(&self, id: BytecodeImmediateId) -> &BytecodeImmediate

Source

pub fn phi(&self, id: BytecodePhiId) -> &BytecodePhi

Source

pub fn projection(&self, id: BytecodeProjectionId) -> &BytecodeProjection

Trait Implementations§

Source§

impl<'table> Clone for BytecodeFunction<'table>

Source§

fn clone(&self) -> BytecodeFunction<'table>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'table> Debug for BytecodeFunction<'table>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'table> PartialEq for BytecodeFunction<'table>

Source§

fn eq(&self, other: &BytecodeFunction<'table>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<'table> StructuralPartialEq for BytecodeFunction<'table>

Auto Trait Implementations§

§

impl<'table> Freeze for BytecodeFunction<'table>

§

impl<'table> RefUnwindSafe for BytecodeFunction<'table>

§

impl<'table> Send for BytecodeFunction<'table>

§

impl<'table> Sync for BytecodeFunction<'table>

§

impl<'table> Unpin for BytecodeFunction<'table>

§

impl<'table> UnsafeUnpin for BytecodeFunction<'table>

§

impl<'table> UnwindSafe for BytecodeFunction<'table>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.