Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Compiler_Bytecode_Function Struct Reference

Bytecode for one lowered function or top-level body. More...

#include <Bytecode.H>

Collaboration diagram for Aleph::Compiler_Bytecode_Function:
[legend]

Public Member Functions

bool is_top_level () const noexcept
 Returns whether this bytecode function represents the top-level body.
 

Public Attributes

Compiler_Bytecode_Function_Id id = compiler_bytecode_invalid_id()
 Stable function id within the module.
 
std::string name
 Debug/source name.
 
bool top_level = false
 Whether this function represents the top-level body.
 
Source_Span span
 Source span of the function/body.
 
Compiler_Type_Id type_id = 0
 Full function type, when known.
 
const Compiler_IR_Function * source_function = nullptr
 Original non-bytecode IR function.
 
DynArray< Compiler_IR_Slot > local_slots
 Local/parameter slot metadata preserved for the VM.
 
DynArray< Compiler_Bytecode_Constant > constants
 Per-function constant pool.
 
DynArray< Compiler_Bytecode_Block_Info > blocks
 Debug mapping from blocks to PCs.
 
DynArray< Compiler_Bytecode_Instruction > code
 Linear bytecode stream.
 
Compiler_Bytecode_PC entry_pc = compiler_bytecode_invalid_id()
 Entry PC used to start execution.
 
Compiler_Bytecode_PC exit_pc = compiler_bytecode_invalid_id()
 PC of the canonical exit instruction.
 
size_t register_count = 0
 Number of virtual registers required by the function.
 

Detailed Description

Bytecode for one lowered function or top-level body.

Definition at line 221 of file Bytecode.H.

Member Function Documentation

◆ is_top_level()

bool Aleph::Compiler_Bytecode_Function::is_top_level ( ) const
inlinenoexcept

Returns whether this bytecode function represents the top-level body.

Definition at line 238 of file Bytecode.H.

References top_level.

Member Data Documentation

◆ blocks

DynArray<Compiler_Bytecode_Block_Info> Aleph::Compiler_Bytecode_Function::blocks

Debug mapping from blocks to PCs.

Definition at line 231 of file Bytecode.H.

Referenced by Aleph::compiler_dump_bytecode_function(), and Aleph::validate_bytecode_function().

◆ code

DynArray<Compiler_Bytecode_Instruction> Aleph::Compiler_Bytecode_Function::code

Linear bytecode stream.

Definition at line 232 of file Bytecode.H.

Referenced by Aleph::compiler_dump_bytecode_function(), and Aleph::validate_bytecode_function().

◆ constants

DynArray<Compiler_Bytecode_Constant> Aleph::Compiler_Bytecode_Function::constants

Per-function constant pool.

Definition at line 230 of file Bytecode.H.

Referenced by Aleph::compiler_dump_bytecode_function().

◆ entry_pc

Compiler_Bytecode_PC Aleph::Compiler_Bytecode_Function::entry_pc = compiler_bytecode_invalid_id()

◆ exit_pc

Compiler_Bytecode_PC Aleph::Compiler_Bytecode_Function::exit_pc = compiler_bytecode_invalid_id()

PC of the canonical exit instruction.

Definition at line 234 of file Bytecode.H.

Referenced by Aleph::compiler_dump_bytecode_function(), and Aleph::validate_bytecode_function().

◆ id

Compiler_Bytecode_Function_Id Aleph::Compiler_Bytecode_Function::id = compiler_bytecode_invalid_id()

Stable function id within the module.

Definition at line 223 of file Bytecode.H.

Referenced by Aleph::Compiler_Bytecode_Lowering::lower_function().

◆ local_slots

DynArray<Compiler_IR_Slot> Aleph::Compiler_Bytecode_Function::local_slots

Local/parameter slot metadata preserved for the VM.

Definition at line 229 of file Bytecode.H.

Referenced by Aleph::compiler_dump_bytecode_function(), and Aleph::Compiler_Bytecode_VM::push_frame().

◆ name

std::string Aleph::Compiler_Bytecode_Function::name

◆ register_count

size_t Aleph::Compiler_Bytecode_Function::register_count = 0

Number of virtual registers required by the function.

Definition at line 235 of file Bytecode.H.

Referenced by Aleph::compiler_dump_bytecode_function(), and Aleph::Compiler_Bytecode_VM::push_frame().

◆ source_function

const Compiler_IR_Function* Aleph::Compiler_Bytecode_Function::source_function = nullptr

Original non-bytecode IR function.

Definition at line 228 of file Bytecode.H.

◆ span

Source_Span Aleph::Compiler_Bytecode_Function::span

Source span of the function/body.

Definition at line 226 of file Bytecode.H.

◆ top_level

bool Aleph::Compiler_Bytecode_Function::top_level = false

Whether this function represents the top-level body.

Definition at line 225 of file Bytecode.H.

Referenced by is_top_level().

◆ type_id

Compiler_Type_Id Aleph::Compiler_Bytecode_Function::type_id = 0

Full function type, when known.

Definition at line 227 of file Bytecode.H.

Referenced by Aleph::compiler_dump_bytecode_function().


The documentation for this struct was generated from the following file: