MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / new

Method new

crates/cranelift/src/compiled_function.rs:79–95  ·  view source on GitHub ↗

Creates a [CompiledFunction] from a [`cranelift_codegen::MachBufferFinalized `] This function uses the information in the machine buffer to derive the traps and relocations fields. The compiled function metadata is loaded with the default values.

(
        buffer: MachBufferFinalized<Final>,
        name_map: PrimaryMap<ir::UserExternalNameRef, ir::UserExternalName>,
        alignment: u32,
    )

Source from the content-addressed store, hash-verified

77 /// This function uses the information in the machine buffer to derive the traps and relocations
78 /// fields. The compiled function metadata is loaded with the default values.
79 pub fn new(
80 buffer: MachBufferFinalized<Final>,
81 name_map: PrimaryMap<ir::UserExternalNameRef, ir::UserExternalName>,
82 alignment: u32,
83 ) -> Self {
84 let mut this = Self {
85 buffer,
86 name_map,
87 alignment,
88 metadata: Default::default(),
89 debug_slot_descriptor: None,
90 breakpoint_patch_points: vec![],
91 };
92 this.finalize_breakpoints();
93
94 this
95 }
96
97 /// Finalize breakpoint patches: edit the buffer to have NOPs by
98 /// default, and place patch data in the debug breakpoint data

Callers

nothing calls this directly

Calls 1

finalize_breakpointsMethod · 0.80

Tested by

no test coverage detected