Sign in

    Milky2018/wasmoon_jit/cwasm does not have a README file

    DeserializeError

    pub suberror DeserializeError {
    DeserializeError(String)
    }

    Error during deserialization

    CallFixup

    pub(all) struct CallFixup {
    offset : Int
    func_idx : Int
    veneer_offset : Int
    }

    Fixup for direct function call branches.

    CompilationFeatures

    pub(all) struct CompilationFeatures {
    cancellation_safepoints : Bool
    } derive(Eq,
    Debug
    )

    Compilation features that affect the generated machine-code contract.

    CompilationFeatures::CompilationFeatures

    fn CompilationFeatures::CompilationFeatures(cancellation_safepoints? : Bool) -> CompilationFeatures

    CompiledEntry

    pub(all) struct CompiledEntry {
    func_idx : Int
    name : String
    code : Array[Int]
    frame_size : Int
    entry_offset : Int
    num_params : Int
    num_results : Int
    func_addr_fixups : Array[FuncAddrFixup]
    call_fixups : Array[CallFixup]
    gc_safepoints : Array[GcSafepoint]
    gc_stackmap_blob : Bytes
    }

    A compiled function entry in the .cwasm file

    CompiledEntry::CompiledEntry

    fn CompiledEntry::CompiledEntry(func_idx : Int, name : String, code : Array[Int], frame_size : Int, entry_offset : Int, num_params : Int, num_results : Int, func_addr_fixups? : Array[FuncAddrFixup], call_fixups? : Array[CallFixup], gc_safepoints? : Array[GcSafepoint], gc_stackmap_blob? : Bytes) -> CompiledEntry

    DataEntry

    pub(all) struct DataEntry {
    memory_idx : Int
    offset : Int
    data : Array[Int]
    }

    A data segment entry (active segments only, with evaluated offset)
    impl Show for DataEntry

    DataEntry::DataEntry

    fn DataEntry::DataEntry(memory_idx : Int, offset : Int, data : Array[Int]) -> DataEntry

    ElemEntry

    pub(all) struct ElemEntry {
    table_idx : Int
    offset : Int
    func_indices : Array[Int]
    }

    An element segment for table initialization
    impl Show for ElemEntry

    ElemEntry::ElemEntry

    fn ElemEntry::ElemEntry(table_idx : Int, offset : Int, func_indices : Array[Int]) -> ElemEntry

    FuncAddrFixup

    pub(all) struct FuncAddrFixup {
    offset : Int
    func_idx : Int
    reg : Int
    }

    Fixup for direct function address loads.

    GcSafepoint

    pub(all) struct GcSafepoint {
    code_offset : Int
    live_refs : Array[Int]
    metadata : Int64
    } derive(
    Debug
    )

    Information about a GC safepoint in generated code.

    GcSafepoint::GcSafepoint

    fn GcSafepoint::GcSafepoint(code_offset : Int, live_refs : Array[Int], metadata : Int64) -> GcSafepoint

    GlobalDef

    pub(all) struct GlobalDef {
    value_type : Int
    mutable : Bool
    init_value : Int64
    }

    A global variable definition with initial value
    impl Show for GlobalDef

    GlobalDef::GlobalDef

    fn GlobalDef::GlobalDef(value_type : Int, mutable : Bool, init_value : Int64) -> GlobalDef

    ImportEntry

    pub(all) struct ImportEntry {
    module_name : String
    func_name : String
    num_params : Int
    num_results : Int
    }

    An imported function entry in the .cwasm file
    impl Show for ImportEntry

    ImportEntry::ImportEntry

    fn ImportEntry::ImportEntry(module_name : String, func_name : String, num_params : Int, num_results : Int) -> ImportEntry

    MemoryDef

    pub(all) struct MemoryDef {
    min_pages : Int
    max_pages : Int?
    }

    Memory definition (min/max pages)
    impl Show for MemoryDef

    MemoryDef::MemoryDef

    fn MemoryDef::MemoryDef(min_pages : Int, max_pages : Int?) -> MemoryDef

    PrecompiledModule

    pub(all) struct PrecompiledModule {
    version : Int
    target : TargetArch
    features : CompilationFeatures
    imports : Array[ImportEntry]
    functions : Array[CompiledEntry]
    memories : Array[MemoryDef]
    data_segments : Array[DataEntry]
    types : Array[TypeEntry]
    globals : Array[GlobalDef]
    tables : Array[TableDef]
    elements : Array[ElemEntry]
    start_func : Int?
    }

    A precompiled WASM module

    PrecompiledModule::PrecompiledModule

    fn PrecompiledModule::PrecompiledModule(target : TargetArch, features? : CompilationFeatures) -> PrecompiledModule

    PrecompiledModule::add_data_segment

    fn PrecompiledModule::add_data_segment(self : PrecompiledModule, memory_idx : Int, offset : Int, data : Array[Int]) -> Unit

    Add a data segment

    PrecompiledModule::add_element

    fn PrecompiledModule::add_element(self : PrecompiledModule, table_idx : Int, offset : Int, func_indices : Array[Int]) -> Unit

    Add an element segment (v5)

    PrecompiledModule::add_function

    fn PrecompiledModule::add_function(self : PrecompiledModule, entry : CompiledEntry) -> Unit

    Add a compiled function

    PrecompiledModule::add_global

    fn PrecompiledModule::add_global(self : PrecompiledModule, value_type : Int, mutable : Bool, init_value : Int64) -> Unit

    Add a global definition (v5)

    PrecompiledModule::add_import

    fn PrecompiledModule::add_import(self : PrecompiledModule, module_name : String, func_name : String, num_params : Int, num_results : Int) -> Unit

    Add an imported function

    PrecompiledModule::add_memory

    fn PrecompiledModule::add_memory(self : PrecompiledModule, min_pages : Int, max_pages : Int?) -> Unit

    Add a memory definition

    PrecompiledModule::add_table

    fn PrecompiledModule::add_table(self : PrecompiledModule, elem_type : Int, min_size : Int, max_size : Int?) -> Unit

    Add a table definition (v5)

    PrecompiledModule::add_type

    fn PrecompiledModule::add_type(self : PrecompiledModule, param_types : Array[Int], result_types : Array[Int]) -> Unit

    Add a type entry (v5)

    PrecompiledModule::function_count

    fn PrecompiledModule::function_count(self : PrecompiledModule) -> Int

    Get number of compiled functions

    PrecompiledModule::import_count

    fn PrecompiledModule::import_count(self : PrecompiledModule) -> Int

    Get number of imports

    PrecompiledModule::serialize

    fn PrecompiledModule::serialize(self : PrecompiledModule) -> Array[Int]

    Serialize a precompiled module to bytes

    PrecompiledModule::set_start_func

    fn PrecompiledModule::set_start_func(self : PrecompiledModule, func_idx : Int) -> Unit

    Set the start function (v5)

    TableDef

    pub(all) struct TableDef {
    elem_type : Int
    min_size : Int
    max_size : Int?
    }

    A table definition
    impl Show for TableDef

    TableDef::TableDef

    fn TableDef::TableDef(elem_type : Int, min_size : Int, max_size : Int?) -> TableDef

    TargetArch

    pub(all) enum TargetArch {
    Unknown
    X86_64
    AArch64
    } derive(
    Debug
    )

    Target architecture for compiled code
    impl Show for TargetArch

    TypeEntry

    pub(all) struct TypeEntry {
    param_types : Array[Int]
    result_types : Array[Int]
    }

    A type entry with full parameter and result types ValueType encoding: 0=I32, 1=I64, 2=F32, 3=F64, 4=FuncRef, 5=ExternRef, etc.
    impl Show for TypeEntry

    TypeEntry::TypeEntry

    fn TypeEntry::TypeEntry(param_types : Array[Int], result_types : Array[Int]) -> TypeEntry

    deserialize

    fn deserialize(bytes : Array[Int]) -> PrecompiledModule raise DeserializeError

    Deserialize a precompiled module from bytes

    encode

    Encode a Module to WebAssembly binary format

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io