Skip to main content

CompiledFunction

Struct CompiledFunction 

Source
pub struct CompiledFunction {
    pub name: String,
    pub code: Vec<u8>,
    pub wasm_ops: Vec<WasmOp>,
    pub relocations: Vec<CodeRelocation>,
    pub line_map: LineMap,
    pub branch_map: BranchMap,
    pub wcet: Option<WcetFunction>,
    pub wcet_intermediate: Option<WcetIntermediate>,
}
Expand description

A single compiled function

Fields§

§name: String

Function name (from WASM export or generated)

§code: Vec<u8>

Raw machine code bytes

§wasm_ops: Vec<WasmOp>

Original WASM ops (retained for verification)

§relocations: Vec<CodeRelocation>

Relocations for external symbol references (BL to bridge functions)

§line_map: LineMap

VCR-DBG-001: per-instruction source map for DWARF .debug_line emission — (machine_offset_within_code, wasm_op_index) captured at encode time, one entry per emitted machine instruction. A None op-index marks an instruction with no originating wasm op (prologue/epilogue, literal-pool word). This is purely additive metadata: it is never serialized unless .debug_line emission is requested, so the emitted .text is byte-identical with or without it. Empty for backends/paths that do not yet produce a source map (RISC-V, the optimized ARM path).

§branch_map: BranchMap

VCR-DEC-003 (#396): per-instruction object-branch class, parallel to line_map. Lets the synth-provenance-v1 emitter enumerate the real object conditional branches (not just re-walk the wasm branch ops). Purely additive metadata: never serialized into .text, so emitted bytes are byte-identical with or without it. Empty for backends/paths that do not produce it (RISC-V, the optimized ARM path).

§wcet: Option<WcetFunction>

#778 (v0.46): the SOUND static worst-case-cycle bound for this function, or a loud decline, computed over the final Thumb-2 instruction stream (see crate::wcet). Some only when the ARM backend produced it (the RISC-V and AArch64 backends carry no cycle model yet → None). Purely additive metadata: derived from the already-decided instruction list, never serialized into .text, so emitted bytes are byte-identical with or without it (frozen-safe). Emitted as the <output>.wcet.json sidecar only under --emit-wcet.

§wcet_intermediate: Option<WcetIntermediate>

#778 phase 3: the per-function WCET INTERMEDIATE (own-body cycles + direct call sites, or a composition-independent decline) BEFORE inter-procedural composition. The module driver composes these across the direct call graph into the final per-function bounds (a caller’s bound = its own body + each direct callee’s bound × the call site’s proven execution count). Some only on the Thumb-2 path that produced wcet. Purely additive, .text-invisible (frozen-safe) — derived from the already-decided instruction list.

Trait Implementations§

Source§

impl Clone for CompiledFunction

Source§

fn clone(&self) -> CompiledFunction

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 Debug for CompiledFunction

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.